Boost logo

Boost Users :

Subject: Re: [Boost-users] Newbie: Partial Problem with link
From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2009-01-24 23:48:02


AMDG

Paul Campbell wrote:
> OK: method A in section 6 # SUCCESS
> g++ -I /usr/local/boost_1_36_0 regex_test.cpp -o regex \
> /usr/local/boost_1_36_0/bin.v2/libs/regex/build/gcc-4.1.2/release/link-static/threading-multi/libboost_regex-gcc41-mt-1_36.a
>
> ./regex < jayne.txt
> > Will Success Spoil Rock Hunter?
>
>
> NG: method B in section 6 #FAILURE
>
> http://www.boost.org/doc/libs/1_37_0/more/getting_started/unix-variants.html
>
> #link-your-program-to-a-boost-library
>
>
> This is a snip from my make file
> do_regex_not_working:
> g++ -I /usr/local/boost_1_36_0 regex_test.cpp -o regex \
> -L
> /usr/local/boost_1_36_0/bin.v2/libs/regex/build/gcc-4.1.2/release/threading-multi/
> \ # don't worry about my mail wrap problem
> -lboost_regex-gcc41-mt-1_36
>
> Execution:
>
> g++ -I /usr/local/boost_1_36_0 regex_test.cpp -o regex \
> -L
> /usr/local/boost_1_36_0/bin.v2/libs/regex/build/gcc-4.1.2/release/threading-multi/
> \
> -lboost_regex-gcc41-mt-1_36
>
> Error Message:
> /usr/bin/ld: cannot find -lboost_regex-gcc41-mt-1_36
> collect2: ld returned 1 exit status
> make: *** [do_regex_not_working] Error 1
>
>
>
> Can you see what could be in error ?

You might first of all try putting the library in a more accessible
location.
    bjam --with-regex stage
will copy all the libraries to /usr/local/boost_1_36_0/stage/lib
This shouldn't have any effect on the linker, but it will make the
command lines a bit shorter.

Try adding the option -Wl,--verbose and take a look at the output.
It might provide some hint about the problem.

In Christ,
Steven Watanabe


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