-whole-archive switch...

Venkatakrishnan, V V.Venkatakrishnan@channels.usa.xerox.com
Tue Mar 12 14:23:00 GMT 2002


Hi,
	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 shared lib.
 	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?



More information about the Gcc-help mailing list