This is the mail archive of the
mailing list for the GCC project.
RE: -whole-archive switch...
- From: "Venkatakrishnan, V" <V dot Venkatakrishnan at channels dot usa dot xerox dot com>
- To: "'Lingegowda, Nagesh'" <Nagesh dot Lingegowda at gtech dot com>
- Cc: gcc-help at gcc dot gnu dot org
- Date: Tue, 12 Mar 2002 17:41:21 -0500
- Subject: RE: -whole-archive switch...
Hmmmmmmmm why and where do I need to include header files? All the symbols
are defined in static libs which 've been successfully compiled. A bunch of
these static libs are then linked to an obj, to form a shared lib, which get
loaded dynamically by my app.
Yeah I'm working on SNMP.
From: Lingegowda, Nagesh [mailto:Nagesh.Lingegowda@gtech.com]
Sent: Tuesday, March 12, 2002 5:31 PM
To: 'Venkatakrishnan, V'
Subject: RE: -whole-archive switch...
Are u including the header files needed by the library XsnmpLib ? use -I to
do that. It should work.
It looks like u are working on snmp stuff.
From: Venkatakrishnan, V [mailto:V.Venkatakrishnan@channels.usa.xerox.com]
Sent: Tuesday, March 12, 2002 5:21 PM
Subject: -whole-archive switch...
I'm using this command
gcc -L. -Wl,-whole-archive -lXtlLib -lXrtlLib -lXenvhlpLib -lSnmpAuxiLib
-lSnmpLib -lXsnmpLib -lsocket -lnsl -fPIC -shared -o TrapRegister.so
register.o or even gcc -L. -Wl,-whole-archive -lXtlLib -lXrtlLib
-lXenvhlpLib -lSnmpAuxiLib -lSnmpLib -lXsnmpLib -lsocket -lnsl
-Wl,-no-whole-archive -fPIC -shared -o TrapRegister.so register.o to build a
But when I load it thru an app I get an error saying that a symbol
defined in XsnmpLib is not found, earlier it was a symbol in XtlLib, it
seems that the whole-archive switch worked only on the first lib eventhough
I've included all of them between -whole and -no-whole-archive.
Any idea? Is there any other way I can shuffle around this switch and
make sure that all the symbols in all the libs get linked properly?