Boost logo

Boost Users :

From: John Maddock (john_at_[hidden])
Date: 2007-04-11 12:22:24


Farraday wrote:
>> However, on linux, the regex functions don't work don't work for some
>> reason. I reinstalled the latest version of the Boost libraries and
>> everything seems fine (ie, I tried the graph container and it works
>> great). I tried both on SuSe linux 10.2 and Ubuntu with gcc 4.1.2
>> and the latest Boost libs 1.33.1 but it fails at compile time. At
>> first I thought I was doing something wrong, but then I tried both
>> the examples provided in the Boost documentation and other
>> examples/tutorials on Boost::regex on the net (ie ,the ones on
>> OnLAMP of O'Reilly and others) and they fail too with the same
>> error(s):
>>
>> "boost_regexp.o: In function `boost::basic_regex<char,
>> boost::regex_traits<char, boost::cpp_regex_traits<char> >
>> >::assign(char const*, char const*, unsigned int)':
>> /usr/include/boost/regex/v4/basic_regex.hpp:254: undefined reference
>> to `boost::basic_regex<char, boost::regex_traits<char,
>> boost::cpp_regex_traits<char> > >::do_assign(char const*, char
>> const*, unsigned int)'"

The error message you give is from the linker not the compiler: it occurs
because you haven't chosen to include the regex binaries in your
application. Depending upon how the binaries were built and installed, then
appending -lboost_regex to your build command may do the trick.

John.


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net