Config problem / initial setup

Here's what will probably be a really easy question (hopefully it is not too far off topic). I'm trying to get Boost installed on my machine, but I haven't been able to get a working program yet. I downloaded the "bjam" program and the source for the libraries. Performing the 'bjam "-sTOOLS=gcc" install' as recommended by the "Getting Started Guide" seemed to run smoothly. (and I can't find any logs in the build directory which which would tell me differently). So next I tried to compile an example program from Regex... http://www.boost.org/libs/regex/example/snippets/credit_card_example.cpp ...this initially failed with a message complaining about "boost/regex.hpp" not being found. So I added an additional include search path... g++ -I /usr/local/include/boost-1_33_1/ credit_card_example.cpp ...this works fine until the linker gets invoked...
/tmp/ccagNJn9.o(.gnu.linkonce.t._ZN5boost11regex_matchIN9__gnu_cxx17__ : undefined reference to `boost::re_detail::perl_matcher<__gnu_cxx::__ collect2: ld returned 1 exit status
...etc. So it looks like it can't find the libraries to link against. But my /usr/local/lib directory has all sorts of libboost* files, including libboost_regex-gcc.so and friends. I've tried a number of other g++ options including "-lboost", "-llibboost", "-llibboost_regex", and "-llibboost_regex-gcc". Any hints on what I might try to get things up and running? My system is Slackware Linux 9.1 and gcc 3.4.2. Thanks, Greg Buchholz

Greg Buchholz wrote:
/tmp/ccagNJn9.o(.gnu.linkonce.t._ZN5boost11regex_matchIN9__gnu_cxx17__ : undefined reference to `boost::re_detail::perl_matcher<__gnu_cxx::__ collect2: ld returned 1 exit status
...etc. So it looks like it can't find the libraries to link against. But my /usr/local/lib directory has all sorts of libboost* files, including libboost_regex-gcc.so and friends. I've tried a number of other g++ options including "-lboost", "-llibboost", "-llibboost_regex", and "-llibboost_regex-gcc". Any hints on what I might try to get things up and running? My system is Slackware Linux 9.1 and gcc 3.4.2.
Try adding "-lboost_regex-gcc", the "lib" prefix is added for you by the linker. -- -- Grafik - Don't Assume Anything -- Redshift Software, Inc. - http://redshift-software.com -- rrivera/acm.org - grafik/redshift-software.com -- 102708583/icq - grafikrobot/aim - Grafik/jabber.org

Rene Rivera wrote:
Greg Buchholz wrote:
I've tried a number of other g++ options including "-lboost", "-llibboost", "-llibboost_regex", and "-llibboost_regex-gcc".
Try adding "-lboost_regex-gcc", the "lib" prefix is added for you by the linker.
Ah, thanks, that did the trick! Greg Buchholz

...etc. So it looks like it can't find the libraries to link against. But my /usr/local/lib directory has all sorts of libboost* files, including libboost_regex-gcc.so and friends. I've tried a number of other g++ options including "-lboost", "-llibboost", "-llibboost_regex", and "-llibboost_regex-gcc". Any hints on what I might try to get things up and running? My system is Slackware Linux 9.1 and gcc 3.4.2.
That would be -lboost_regex-gcc, but see the getting started guide for more information on how different build variants get named. John.
participants (3)
-
Greg Buchholz
-
John Maddock
-
Rene Rivera