From: Christophe TROESTLER <Christophe.Troestler+ocaml@umons.ac.be>
To: Pierre-Loic.Garoche@onera.fr
Cc: OCaml Mailing List <caml-list@yquem.inria.fr>
Subject: Re: [Caml-list] Dynamic loading of native code : what about librairies and packs ?
Date: Tue, 01 Sep 2009 11:13:12 +0200 (CEST) [thread overview]
Message-ID: <20090901.111312.1063266217938486339.Christophe.Troestler+ocaml@umons.ac.be> (raw)
In-Reply-To: <20090901085647.GF4549@onera.fr>
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.
next prev parent reply other threads:[~2009-09-01 9:13 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-03-31 16:24 Pierre-Loïc Garoche
2009-03-31 16:34 ` [Caml-list] " Alain Frisch
2009-03-31 16:38 ` Pierre-Loïc Garoche
2009-03-31 17:14 ` Alain Frisch
2009-09-01 8:56 ` Pierre-Loïc Garoche
2009-09-01 9:13 ` Christophe TROESTLER [this message]
2009-09-01 10:01 ` Alain Frisch
2009-04-01 9:02 ` Julien Signoles
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20090901.111312.1063266217938486339.Christophe.Troestler+ocaml@umons.ac.be \
--to=christophe.troestler+ocaml@umons.ac.be \
--cc=Pierre-Loic.Garoche@onera.fr \
--cc=caml-list@yquem.inria.fr \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox