From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by walapai.inria.fr (8.13.6/8.13.6) with ESMTP id p8EG80fr027408 for ; Wed, 14 Sep 2011 18:08:01 +0200 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AtcFANDQcE7VuiYS/2dsb2JhbABBhAxJoReBe3iBUwEBBQwXVhAJAhoCJgICLCsGiAyjTJIPDoEehDGBEQSkZg X-IronPort-AV: E=Sophos;i="4.68,381,1312149600"; d="scan'208";a="119832433" Received: from solaria.dimino.org ([213.186.38.18]) by mail1-smtp-roc.national.inria.fr with ESMTP; 14 Sep 2011 18:07:56 +0200 Received: from aurora (localhost.localdomain [127.0.0.1]) by solaria.dimino.org (Postfix) with ESMTP id BA9DC80048; Wed, 14 Sep 2011 18:07:55 +0200 (CEST) Received: by aurora (Postfix, from userid 1000) id 6A06D41EA6; Wed, 14 Sep 2011 18:07:56 +0200 (CEST) From: =?ISO-8859-1?Q?J=E9r=E9mie?= Dimino To: Romain Bardou Cc: Benedikt Meurer , OCaml List Date: Wed, 14 Sep 2011 18:07:56 +0200 In-Reply-To: <4E70D04B.1040303@lri.fr> References: <4E70C18F.3040304@lri.fr> <83695D27-A767-438A-B909-6864D1A655FE@googlemail.com> <4E70CEAE.8030807@lri.fr> <33CE5892-E862-47D0-9ECA-3C1D7BD9EA2A@googlemail.com> <4E70D04B.1040303@lri.fr> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.0.3- Message-ID: <1316016476.24759.25.camel@aurora> Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by walapai.inria.fr id p8EG80fr027408 Subject: Re: [Caml-list] Link a .so/.dll dynamically Le mercredi 14 septembre 2011 à 18:03 +0200, Romain Bardou a écrit : > > $ ocamlmklib -ldopt -shared wrapper.o mylib.cmx -o mylib > > I tried and I still get the same "invalid ELF header" message. > > I also tried : > ocamlmklib -ocamlopt "ocamlopt -shared" > but then ocamlopt complains that it has been called with too many -a, > -shared, ... arguments. cmxa cannot be loaded dynamically, you need to create a cmxs from the cmxa with the following command: ocamlopt -shared -linkall foo.cmxa -o foo.cmxs and then load the cmxs dynamically with Dynlink. -- Jérémie