[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: gcc-ld woes



>>>>> "Scott" == Scott Bigham <dsb@goldfinch.cs.duke.edu> writes:

> [...]
>   - It apparently doesn't scan libraries multiple times, leading to
>     scads of undefined symbols unless I explicitly put every library on
>     the command line twice.

Well, as far as I know there has to be the symbol table at the
beginning of the library. This table can be created using the s-Option
of ar. Then ld seems to work and you only need to put the libraries
once on the command line. I always create my libraries using

  ar rcs <lib.olb> <files.o>

As far as I remember you can create the symbol table again with a
command like

  ar ts <lib.olb>

This option s replaces ranlib that was used in BSD-like environments.
I believe some people simply forget to put s in their ar-command.

Bye,

  Hartmut


----------------------------------------------------------------------
   Hartmut Keller, Universitaet Stuttgart, Institut fuer Informatik
          Abt. Programmiersprachen und Uebersetzer (SunTREC)
      Breitwiesenstr. 20-22, 70565 Stuttgart, Tel. 0711/7816-345
              E-Mail: keller@informatik.uni-stuttgart.de
----------------------------------------------------------------------