the way ld evaluates and chooses libraries

Jeremy Monnet
Sat Oct 14 17:57:00 GMT 2006

Hi Nick,

Thanks for your answer.

On 10/13/06, Nick Clifton <> wrote:
> Hi Jeremy,
> It sounds as though the problem you were having was because the
> .so.9.0 file was linking with and that this library was
> also being used to resolve all the other undefined (c++) symbols used in
> other, earlier object files and libraries.  So what you might be able to
> do is to place the library as the last item on the
> linker's command line and place before it.  That way
> will be used to resolve all the other c++ symbols for all
> the other object files, but because comes after it on the
> command line, it will not be used to resolve symbols in that library.

That explains why I don't get errors anymore when I add -lstdc++ at
the beginning of the line. The last error that comes from oracle lib
just means in the end that this version of the lib is screwed up ...

To make it short, when I try to link it fails with lot of errors. When
I add -lstdc++ et the beginning of the command line, I get only one
error with the oracle lib (which means all the other symbols were
correctly resolved)

# ldd /opt/oracle/product/9.2.0/lib/ => /usr/lib/ (0x00802000)

# gcc296 -lstdc++ -locci
/opt/oracle/product/9.2.0/lib// undefined reference to

Well, to fix it badly, I just copied a running libocci from another
server straight on this one, and it worked (even if this is probably
not the better way to do it).

Thanks a lot for taking time to explain this !

Linux Registered User #317862
Linux From Scratch Registered User #16571
Please do not send me .doc, .xls, .ppt, as I will *NOT* read them.
Please send me only open formats, as OpenDocument or pdf.

More information about the Binutils mailing list