Boost logo

Boost Users :

From: Jeffrey Holle (jeff.holle_at_[hidden])
Date: 2004-12-11 13:50:22


You need to link to a library to use boost::regex.
It looks like you have the choice of debug/release
single/multi-threaded, static library only.
The "*.a" files are in $BOOST_ROOT/bin/boost/libs/regex directory tree.

Laurent AUDIBERT wrote:
> Hello
> I would like ot use g++ to compile a programme which use boost regex
> To use regex I put this lines in the header of test_expreg.cpp :
> #include <boost/cregex.hpp>
> #include <boost/regex.hpp>
>
> The file compiles fine with this command line :
> g++ -c test_expreg.cpp -o test_expreg.o
>
> But I can't link :
> g++ -o test_expreg test_expreg.o
> Produce error :
> : undefined reference to `boost::RegEx::RegEx(std::basic_string<char,
> std::char_traits<char>, std::allocator<char> > const&, bool)'
>
> I tried :
> g++ -o test_expreg test_expreg.o -L/usr/bin -llibboost_regex
>
> And obtained this error :
> /usr/bin/ld: ne peut trouver -llibboost_regex
>
> Someone could tel me how compile correcly this programme that already
> compiles well en Microsoft Visual C++
> but that I can't compile with g++ on Linux Fecora Core 3
>
> Thanks, Laurent


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