Boost logo

Boost Users :

From: Jonas Hansson (jonas_at_[hidden])
Date: 2007-10-31 05:08:42


On Wed, 31 Oct 2007 01:28:47 +0100, Mike Thornton <endoscope_at_[hidden]>
wrote:

> 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<char const*,

<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

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