This is the mail archive of the
mailing list for the GCC project.
RE: Errors building shared lib...
- From: "Venkatakrishnan, V" <V dot Venkatakrishnan at channels dot usa dot xerox dot com>
- To: "'Joseph Martin'" <Joseph dot Martin at netiq dot com>, gcc-help at gcc dot gnu dot org
- Date: Thu, 7 Mar 2002 15:26:46 -0500
- Subject: RE: Errors building shared lib...
Using the -fPIC worked, but now I've run into something else...... :-/
When I load the shared object TrapRegister.so thru another app. and call
some interface, I get an error....
Ld.so.1: ./testapp: fatal : relocation error: file
/blahblahblah/TrapRegister.so: symbol XTLInit: referenced symbol not found
Now this symbol XTLInit is defined in my static library XtlLib which I had
linked to TrapRegister.so. So why does it say symbol not found???
PS: There is one thing I think might be the cause but I'm not sure, when
building my test application that loads the shared lib, I got an error
saying libstdc++.so.2.10.0 not found, so I had downloaded it from
http://kde.planetmirror.com/pub/kde/stable/2.2/Solaris/Sparc/ but it's for
Sol 7 and I'm using Solaris 8. Could this be the problem?? Where can I get
libstdc++.so.2.10.0 for Sol 8?
From: Joseph Martin [mailto:Joseph.Martin@netiq.com]
Sent: Thursday, March 07, 2002 1:12 PM
To: 'Venkatakrishnan, V'; email@example.com
Subject: RE: Errors building shared lib...
You may want to try using -fPIC
From: Venkatakrishnan, V [mailto:V.Venkatakrishnan@channels.usa.xerox.com]
Sent: Thursday, March 07, 2002 12:17 PM
Subject: Errors building shared lib...
I had built an application earlier using gcc2.95 on Solaris8, the
gcc register.o -L. -lXtlLib -lXrtlLib -lXenvhlpLib -lSnmpAuxiLib
-lSnmpLib -lXsnmpLib -lsocket -lnsl -lXsnmpLib -lSnmpLib -lSnmpAuxiLib
-lXenvhlpLib -lXrtlLib -lXtlLib -o TrapRegister
(the libraries have been repeated to avoid circular referencing)
but now I basically need to convert the functionality of my app
"TrapRegister" to a shared library. So I basically removed the main() from
my .c file and did the necessary things to export the interfaces and
compiled to give the .o. Tried to build my shared library by saying...
gcc -L. -L. -lXtlLib -lXrtlLib -lXenvhlpLib -lSnmpAuxiLib -lSnmpLib
-lXsnmpLib -lsocket -lnsl -lXsnmpLib -lSnmpLib -lSnmpAuxiLib -lXenvhlpLib
-lXrtlLib -lXtlLib -shared -o TrapRegister.so register.o
but I get a whole bunch of linking errors as shown in errors.txt
Is there something wrong with my command, (I used the same approach
on AIX4.3 using gcc 2.95 and it worked fine.)
Can someone help me out here please.