English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

Browse thread
[Caml-list] linking order of C libraries.
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2004-02-20 (19:33)
From: ecc+@e...
Subject: Re: [Caml-list] linking order of C libraries.
On Wed, Feb 11, 2004 at 06:21:15PM +0900, Yamagata Yoriyuki wrote:
> It would be dumb to ask, but what is the effect of order in which C
> libraries are given to ocamlc?

This is from the man page for GNU ld:

    The  linker will search an archive only once, at the location where
    it is specified on the command line.  If the archive defines a sym-
    bol  which  was  undefined in some object which appeared before the
    archive on the command line, the linker will include the  appropri-
    ate  file(s)  from the archive.  However, an undefined symbol in an
    object appearing later on the  command  line  will  not  cause  the
    linker to search the archive again.

    See  the -( option for a way to force the linker to search archives
    multiple times.

    You may list the same archive multiple times on the command line.

I didn't know about the "-(" and "-)" options.  Perhaps the ld
commands generated by the ocaml tools should use this to make library
order less error-prone?

Eric C. Cooper          e c c @ c m u . e d u

To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners