This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: LIBRARY_PATH not used before /usr/lib anymore in gcc 4.2 and later?
On Wed, 11 Jun 2008 14:55:54 +0100, Andrew Haley wrote:
> Frederik wrote:
>> On Wed, 11 Jun 2008 13:46:45 +0100, Andrew Haley wrote:
>>
>>> What does readelf -d test say?
>>
>> $ echo $LIBRARY_PATH
>> /cvos/shared/apps/gcc/gcc-4.2.4//lib:/cvos/shared/apps/boost/
gcc-4.2/1.35.0/lib
>
> I'm not sure this will have any effect.
Isn't the above necessary so that it searches for the libboost_regex.so
link in that directory, which would make it build at compile time against
libboost.so.1.35.0 in my case? (Well, that's what I expected, but it
clearly does not do that here when using gcc 4.2 or 4.3)
>> $ echo $LD_LIBRARY_PATH
>> /cvos/shared/apps/gcc/gcc-4.2.4//lib:/cvos/shared/apps/boost/
gcc-4.2/1.35.0/lib:/cvos/shared/apps/sge/6.1/lib/lx26-amd64
> This should work, though.
>> $ g++ -o test test.cpp -lboost_regex
>
> Use `gcc -v' here. Let's see what that says.
$ gcc -v -o test test.cpp -lboost_regex
Using built-in specs.
Target: x86_64-unknown-linux-gnu
Configured with: ../gcc-4.2.4/configure --prefix=/cvos/shared/apps/gcc/
gcc-4.2.4
Thread model: posix
gcc version 4.2.4
/cvos/shared/apps/gcc/gcc-4.2.4/libexec/gcc/x86_64-unknown-linux-
gnu/4.2.4/cc1plus -quiet -v -D_GNU_SOURCE test.cpp -quiet -dumpbase
test.cpp -mtune=generic -auxbase test -version -o /tmp/ccpVNcg5.s
ignoring nonexistent directory "/cvos/shared/apps/gcc/gcc-4.2.4/lib/gcc/
x86_64-unknown-linux-gnu/4.2.4/../../../../x86_64-unknown-linux-gnu/
include"
ignoring duplicate directory "/cvos/shared/apps/gcc/gcc-4.2.4//include"
as it is a non-system directory that duplicates a system directory
#include "..." search starts here:
#include <...> search starts here:
/cvos/shared/apps/boost/gcc-4.2/1.35.0/include
/cvos/shared/apps/gcc/gcc-4.2.4/lib/gcc/x86_64-unknown-linux-
gnu/4.2.4/../../../../include/c++/4.2.4
/cvos/shared/apps/gcc/gcc-4.2.4/lib/gcc/x86_64-unknown-linux-
gnu/4.2.4/../../../../include/c++/4.2.4/x86_64-unknown-linux-gnu
/cvos/shared/apps/gcc/gcc-4.2.4/lib/gcc/x86_64-unknown-linux-
gnu/4.2.4/../../../../include/c++/4.2.4/backward
/usr/local/include
/cvos/shared/apps/gcc/gcc-4.2.4/include
/cvos/shared/apps/gcc/gcc-4.2.4/lib/gcc/x86_64-unknown-linux-gnu/4.2.4/
include
/usr/include
End of search list.
GNU C++ version 4.2.4 (x86_64-unknown-linux-gnu)
compiled by GNU C version 4.2.4.
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: f57f9fabb561926a37300247be5d9b7d
as -V -Qy -o /tmp/ccRPEZKW.o /tmp/ccpVNcg5.s
GNU assembler version 2.17.50.0.6-5.el5 (x86_64-redhat-linux) using BFD
version 2.17.50.0.6-5.el5 20061020
/cvos/shared/apps/gcc/gcc-4.2.4/libexec/gcc/x86_64-unknown-linux-
gnu/4.2.4/collect2 --eh-frame-hdr -m elf_x86_64 -dynamic-linker /lib64/ld-
linux-x86-64.so.2 -o test /usr/lib/../lib64/crt1.o /usr/lib/../lib64/
crti.o /cvos/shared/apps/gcc/gcc-4.2.4/lib/gcc/x86_64-unknown-linux-
gnu/4.2.4/crtbegin.o -L/cvos/shared/apps/gcc/gcc-4.2.4//lib/../lib64 -L/
cvos/shared/apps/gcc/gcc-4.2.4/lib/gcc/x86_64-unknown-linux-gnu/4.2.4 -L/
cvos/shared/apps/gcc/gcc-4.2.4/lib/gcc/x86_64-unknown-linux-
gnu/4.2.4/../../../../lib64 -L/lib/../lib64 -L/usr/lib/../lib64 -L/cvos/
shared/apps/gcc/gcc-4.2.4//lib -L/cvos/shared/apps/boost/gcc-4.2/1.35.0/
lib -L/cvos/shared/apps/gcc/gcc-4.2.4/lib/gcc/x86_64-unknown-linux-
gnu/4.2.4/../../.. /tmp/ccRPEZKW.o -lboost_regex -lgcc --as-needed -
lgcc_s --no-as-needed -lc -lgcc --as-needed -lgcc_s --no-as-needed /cvos/
shared/apps/gcc/gcc-4.2.4/lib/gcc/x86_64-unknown-linux-gnu/4.2.4/
crtend.o /usr/lib/../lib64/crtn.o
--
Frederik