Re: dynamic linking and C libraries

From: Xavier Leroy (Xavier.Leroy@inria.fr)
Date: Tue Feb 10 1998 - 21:23:52 MET


From: Xavier Leroy <Xavier.Leroy@inria.fr>
Message-Id: <199802102023.VAA17664@pauillac.inria.fr>
Subject: Re: dynamic linking and C libraries
In-Reply-To: <199801270354.WAA08593@codex.cis.upenn.edu> from Scott Alexander at "Jan 26, 98 10:54:58 pm"
To: salex@dsl.cis.upenn.edu (Scott Alexander)
Date: Tue, 10 Feb 1998 21:23:52 +0100 (MET)

> I am having a problem when I try to dynamically link code which uses
> functions from C libraries (externals). I sometimes get a message like:
>
> The external function `is_digit_odd' is not available
>
> My workaround for this is to call the function in some statically linked
> part of the program. Is there a better fix for this problem?

Try using the "-linkall" option to ocamlc when linking your main
application (the one that does the dynamic linking).

The "-linkall" option disables the normal elimination of unused
modules and C primitives, and makes sure that all the modules and
libraries you mention on the command line are linked in and thus
available to dynamically-linked code. (The accompanying C primitives
are dragged in the executable along the way.)

Hope this helps.

- Xavier Leroy



This archive was generated by hypermail 2b29 : Sun Jan 02 2000 - 11:58:13 MET