LIBRARY_PATH not used before /usr/lib anymore in gcc 4.2 and later?
Frederik
freggy@gmail.com
Wed Jun 11 13:28:00 GMT 2008
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
$ 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
$ g++ -o test test.cpp -lboost_regex
$ readelf -d test
Dynamic section at offset 0xf778 contains 24 entries:
Tag Type Name/Value
0x0000000000000001 (NEEDED) Shared library:
[libboost_regex.so.2]
0x0000000000000001 (NEEDED) Shared library: [libstdc++.so.6]
0x0000000000000001 (NEEDED) Shared library: [libm.so.6]
0x0000000000000001 (NEEDED) Shared library: [libgcc_s.so.1]
0x0000000000000001 (NEEDED) Shared library: [libc.so.6]
0x000000000000000c (INIT) 0x403d58
0x000000000000000d (FINI) 0x40b2a0
0x0000000000000004 (HASH) 0x400240
0x0000000000000005 (STRTAB) 0x400f48
0x0000000000000006 (SYMTAB) 0x400570
0x000000000000000a (STRSZ) 10385 (bytes)
0x000000000000000b (SYMENT) 24 (bytes)
0x0000000000000015 (DEBUG) 0x0
0x0000000000000003 (PLTGOT) 0x60f950
0x0000000000000002 (PLTRELSZ) 1008 (bytes)
0x0000000000000014 (PLTREL) RELA
0x0000000000000017 (JMPREL) 0x403968
0x0000000000000007 (RELA) 0x403920
0x0000000000000008 (RELASZ) 72 (bytes)
0x0000000000000009 (RELAENT) 24 (bytes)
0x000000006ffffffe (VERNEED) 0x4038b0
0x000000006fffffff (VERNEEDNUM) 3
0x000000006ffffff0 (VERSYM) 0x4037da
0x0000000000000000 (NULL) 0x0
$ ls -l /cvos/shared/apps/boost/gcc-4.2/1.35.0/lib/*regex*
lrwxrwxrwx 1 root root 27 Jun 11 12:22 /cvos/shared/apps/boost/
gcc-4.2/1.35.0/lib/libboost_regex-mt.so -> libboost_regex-mt.so.1.35.0
-rwxr-xr-x 1 root root 5881209 Jun 11 12:22 /cvos/shared/apps/boost/
gcc-4.2/1.35.0/lib/libboost_regex-mt.so.1.35.0
lrwxrwxrwx 1 root root 24 Jun 11 12:21 /cvos/shared/apps/boost/
gcc-4.2/1.35.0/lib/libboost_regex.so -> libboost_regex.so.1.35.0
-rwxr-xr-x 1 root root 5881164 Jun 11 12:21 /cvos/shared/apps/boost/
gcc-4.2/1.35.0/lib/libboost_regex.so.1.35.0
So here I would have expected it to link against libboost_regex.so.1.35.0
instead of libboost_regex_so.2. What am I doing wrong here?
--
Frederik
More information about the Gcc-help
mailing list