|
From: | Venkatakrishnan, V |
Subject: | SOS... |
Date: | Wed, 24 Oct 2001 15:06:43 -0400 |
Hi,
I'm using
this command to link my obj with a few static libs...
gcc
register.o -L. -lXtlLib -lXrtlLib -lXSnmpLib -lXenvhlpLib -lSnmpAuxiLib
-lSnmpLib -o TrapRegister
but I get
linking errors saying undefined references coz. the libraries are getting linked
sequentially and a library occuring earlier in the sequence might be trying to
refer to a function that's being linked later in the
sequence.
A man on
ld gave me the switch shown below, which I think is the solution but I can't
seem to get it working.......I tried things like....
gcc
register.o -L. -(-lXtlLib -lXrtlLib .....) -o TrapRegister
or
gcc
register.o -L. -l(XtlLib XrtlLib.....) -o TrapRegister and a few more....
but
none of them worked......... do you now how to use this switch exactly? Could you
please give me an example?
-( archives -)
--start-group archives
--end-group
The archives should be a list of archive files. They may be either explicit file names, or -l options. The
specified archives are searched repeatedly until
no new undefined references are created. Normally, an archive is searched only once in the order that it is specified on the command line. If a symbol in that archive is needed to resolve an undefined symbol referred to by an object in an archive that appears later on the command line, the linker would not be able to resolve that reference. By grouping the archives, they all be searched repeatedly until all possible references are resolved. Using this option has
a significant performance cost.
It is best to use it only when there are unavoidable circular references between two or more archives. Regards,
Venky |
[Prev in Thread] | Current Thread | [Next in Thread] |