You are not logged in.
Pages: 1
Hi, I have a strange problem with ld, I think it's an issue of standard paths. I have boost 1.41 on my Arch laptop, but at work I mount some NFS disks and write code in a network environment where boost 1.42 is installed. I link my code passing the boost 1.42 lib directory to the linker using the -L option; in particular, I use the options -L<boost 1.42 lib dir> -lboost_filesystem. It seems that the linker correctly finds libboost_filesystem.so 1.42, but then when it searches for libboost_system.so it finds version 1.41 (the one installed on my /usr/lib), since I get this error:
/usr/bin/ld: warning: libboost_system.so.1.42.0, needed by /wizard/04/mori/software/boost/lib/libboost_filesystem.so, not found (try using -rpath or -rpath-link)
It seems to me that the -L linker option just works for the library which is included in the linker invocation with -l, while other libraries are searched only in standard directories (in fact, if I add boost 1.42 lib to my LD_LIBRARY_PATH, the error vanishes). Am I right? If so, don't you think that it will be more logical and useful if ld would search all the libraries starting from the dirs specified by -L?
Many thanks
Offline
From the gcc manual:
-Ldir
Add directory dir to the list of directories to be searched for -l.
means you are right.
I don't know of an alternative to LD_LIBRARY_PATH that is using gcc flags.
Good ideas do not need lots of lies told about them in order to gain public acceptance.
Offline
Pages: 1