From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from weis@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id UAA12141 for caml-redistribution; Fri, 13 Feb 1998 20:42:22 +0100 (MET) Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id VAA17668 for ; Tue, 10 Feb 1998 21:23:56 +0100 (MET) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by concorde.inria.fr (8.8.7/8.8.5) with ESMTP id VAA24766; Tue, 10 Feb 1998 21:23:53 +0100 (MET) Received: (from xleroy@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id VAA17664; Tue, 10 Feb 1998 21:23:52 +0100 (MET) From: Xavier Leroy 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) Cc: caml-list@inria.fr MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: weis > 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