From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: * X-Spam-Status: No, score=1.3 required=5.0 tests=AWL,SPF_SOFTFAIL autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by yquem.inria.fr (Postfix) with ESMTP id 39F27BC37 for ; Tue, 1 Sep 2009 11:13:14 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AsUCAAOCnErBvsFKfGdsb2JhbACbJwEBCxUFwCqEGgU X-IronPort-AV: E=Sophos;i="4.44,311,1249250400"; d="scan'208";a="33527537" Received: from dnsp.umh.ac.be (HELO hermes1.umh.ac.be) ([193.190.193.74]) by mail3-smtp-sop.national.inria.fr with ESMTP; 01 Sep 2009 11:13:13 +0200 Received: from poincare.swapping.umh.ac.be (poincare.swapping.umh.ac.be [10.102.100.32]) by hermes1.umh.ac.be (8.14.2/8.13.6) with ESMTP id n8198G4x503910; Tue, 1 Sep 2009 11:08:16 +0200 Received: from localhost ([127.0.0.1] ident=trch) by poincare.swapping.umh.ac.be with esmtp (Exim 4.69) (envelope-from ) id 1MiPQO-00024Z-Jt; Tue, 01 Sep 2009 11:13:12 +0200 Date: Tue, 01 Sep 2009 11:13:12 +0200 (CEST) Message-Id: <20090901.111312.1063266217938486339.Christophe.Troestler+ocaml@umons.ac.be> To: Pierre-Loic.Garoche@onera.fr Cc: OCaml Mailing List Subject: Re: [Caml-list] Dynamic loading of native code : what about librairies and packs ? From: Christophe TROESTLER In-Reply-To: <20090901085647.GF4549@onera.fr> References: <49D243B0.6020103@onera.fr> <49D24603.7060509@frisch.fr> <20090901085647.GF4549@onera.fr> X-Face: #2fb%mPx>rRL@4ff~TVgZ"<[:,oL"`TUEGK/[8/qb58~C>jR(x4A+v/n)7BgpEtIph_neoLKJBq0JBY9:}8v|j Organization: University of Mons Return-Receipt-To: Christophe.Troestler@umons.ac.be Disposition-Notification-To: Christophe.Troestler@umons.ac.be X-Mailer: Mew version 6.2.51 on Emacs 23.1 / Mule 6.0 (HANACHIRUSATO) Mime-Version: 1.0 Content-Type: Text/Plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.64 on 193.190.193.76 X-Spam: no; 0.00; librairies:01 christophe:01 troestler:01 christophe:01 troestler:01 ocaml:01 0200,:01 hashtbl:01 hashtbl:01 dynlink:01 loadfile:01 bytecode:01 dynlink:01 loadfile:01 cmo:01 On Tue, 1 Sep 2009 10:56:47 +0200, Pierre-Loïc Garoche wrote: > > Question: How should I link it to rely on external libraries and > produce a valid MyPlugin.cmxs ? You should reference « Hashtbl » in your main program : > main.ml: module ForLinking_1 = Hashtbl let () = print_string "main\n" let () = Dynlink.loadfile "MyPlugin.cmxs" BTW, if you want your program to work in both bytecode and native code, you should use: Dynlink.loadfile (Dynlink.adapt_filename "MyPlugin.cmo") Cheers, C.