On Wed, 31 Oct 2007 01:28:47 +0100, Mike Thornton
Using g++ on a GNU Ubuntu Linux 7.04 machine, I am unable to compile the boost example code (saved as test.cpp) at
http://www.boost.org/libs/regex/example/snippets/partial_regex_match.cpp
Although I can compile my own code which does not use boost, I get a lot of garbled output from the example code...part of which is listed below. Any ideas on what is wrong and how to fix it?
test.cpp :
<snip>
)]+0xea): undefined reference to `boost::re_detail::perl_matcher<__gnu_cxx::__normal_iterator
<snip> "undefined reference to" means the linker cannot find the function. You need to tell your linker to include the regex library, called something like `libboost_regex-gcc`. Add it with the -l parameter, e.g. `-lboost_regex-gcc` -- Jonas Hansson