Пишу код:
==============
#include <iostream>
#include <string>
#include <cstdlib>
#include <boost/regex.hpp>
using namespace std;
using namespace boost;
int main ()
{
regex R = ("[a-c]");
cmatch M;
regex_match ("1 2 3 a d b dd", M, R);
return 0;
}
==============
компилирую: g++ -c -I/usr/local/include/boost-1_33_1 -o test.o test.cpp
(всё ок, получается test.o)
пытаюсь слинковать:
g++ -o test -L/usr/local/lib test.o
получаю длинющую ошибку:
test.o(.gnu.linkonce.t._ZN5boost11regex_matchIPKcSaINS_9sub_matchIS2_EEEcNS_12re
gex_traitsIcNS_16cpp_regex_traitsIcEEEEEEbT_SA_RNS_13match_resultsISA_T0_EERKNS_
11basic_regexIT1_T2_EENS_15regex_constants12_match_flagsE+0x33): In function `bool boost::regex_match<char const*, std::allocator<boost::sub_match<char const*> >, char, boost::regex_traits<char, boost::cpp_regex_traits<char> > >(char const*, char const*, boost::match_results<char const*, std::allocator<boost::sub_match<char const*> > >&, boost::basic_regex<char, boost::regex_traits<char, boost::cpp_regex_traits<char> > > const&, boost::regex_constants::_match_flags)':
: undefined reference to `boost::re_detail::perl_matcher<char const*, std::allocator<boost::sub_match<char const*> >, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::match()'
test.o(.gnu.linkonce.t._ZN5boost9re_detail12perl_matcherIPKcSaINS_9sub_matchIS3_
EEENS_12regex_traitsIcNS_16cpp_regex_traitsIcEEEEEC1ES3_S3_RNS_13match_resultsIS
3_S6_EERKNS_11basic_regexIcSA_EENS_15regex_constants12_match_flagsES3_+0x9d): In function `boost::re_detail::perl_matcher<char const*, std::allocator<boost::sub_match<char const*> >, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::perl_matcher[in-charge](char const*, char const*, boost::match_results<char const*, std::allocator<boost::sub_match<char const*> > >&, boost::basic_regex<char, boost::regex_traits<char, boost::cpp_regex_traits<char> > > const&, boost::regex_constants::_match_flags, char const*)':
: undefined reference to `boost::re_detail::perl_matcher<char const*, std::allocator<boost::sub_match<char const*> >, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::construct_init(boost::basic_regex<char, boost::regex_traits<char, boost::cpp_regex_traits<char> > > const&, boost::regex_constants::_match_flags)'
collect2: ld returned 1 exit status
что не так делаю?