|
Boost Users : |
From: Raúl Huertas (raulh39_at_[hidden])
Date: 2006-12-11 14:29:07
Forever Kid escribió:
> Thanks for the reply.
>
> When I change the linker line to this (added the .a
> extension):
> g++
> -L/home/fejimush/development/libraries/boost_1_33_1/stage/lib
> -o"ManagedMakeProject" ./main.o
> -lboost_thread-gcc-mt-d-1_33_1.a
>
> I get the follow error:
> /usr/lib/gcc/i686-pc-linux-gnu/4.1.1/../../../../i686-pc-linux-gnu/bin/ld:
> cannot find -lboost_thread-gcc-mt-d-1_33_1.a
>
> The file is there and everything seems to be spelled
> correctly, path and filename.
>
>
If you want that the linker doesn't search the library, you dont have to
use the -l flag.
Try linking with this:
g++ \
-o"ManagedMakeProject" ./main.o \
/home/fejimush/development/libraries/boost_1_33_1/stage/lib/libboost_thread-gcc-mt-d-1_33_1.a
(Assuming that the file libboost_thread-gcc-mt-d-1_33_1.a is in the
directory /home/fejimush/development/libraries/boost_1_33_1/stage/lib)
The -l flag searches first for the dinamic (.so) library, and only if it
can't find it, it searches for the static version.
But, returning to your first post, I think that your problem doesn't
happens at build time, does it?
When do you get the message "error while loading shared libraries"? At
link time or at run time?
If you are sure that the file
/home/quirk/dev/libraries/boost_1_33_1/stage/lib/libboost_thread-gcc-mt-d-1_33_1.so
exists and that the problem is at run time, then try this:
g++ -L/home/quirk/dev/libraries/boost_1_33_1/stage/lib \
-o"ManagedMakeProject" ./main.o -lpthread \
-lboost_thread-gcc-mt-d-1_33_1 \
-Wl,-rpath,/home/quirk/dev/libraries/boost_1_33_1/stage/lib
Regards,
Raul.
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