This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
g++, RH 2.1 and rpath
- From: "Ajay Bansal" <Ajay_Bansal at infosys dot com>
- To: <gcc-help at gcc dot gnu dot org>
- Cc: "Pankaj Garg" <pankaj_garg at infosys dot com>
- Date: Wed, 2 Jul 2003 20:21:11 +0530
- Subject: g++, RH 2.1 and rpath
Hi All
I am compiling a program which links with a certain library.
g++ -o test test.cpp -L/home/thirdparty/lib -llib1
/usr/bin/ld: warning: liblib2.so, needed by
/home/thirdparty/lib/liblib1.so, not found (try using -rpath or
-rpath-link)
/home/thirdparty/lib/liblib1.so: undefined reference to `funcGetString'
collect2: ld returned 1 exit status
So I use rpath. But then I get following error
g++ -o test test.cpp -rpath /home/thirdparty/lib -llib1
g++: unrecognized option `-rpath'
/home/thirdparty/lib: file not recognized: Invalid argument
collect2: ld returned 1 exit status
Then I use ld instead of rpath (But in my actual program I HAVE to use
g++ for linking)
ld -o test test.cpp -rpath /home/thirdparty/lib -L/home/thirdparty/lib
-llib1
ld: warning: cannot find entry symbol _start; defaulting to 080483a8
ldap.o(.eh_frame+0x11): undefined reference to `__gxx_personality_v0'
What should I do????? Please note that this is just a sample output. I
link to many thirdpaty libs. Some of them has 10 or more dependent libs
so I can not link against all of them. Linker should find the dependent
libs by itself.
Regards
Ajay