caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: "Warp" <warplayer@free.fr>
To: "OCaml" <caml-list@inria.fr>
Subject: [Caml-list] Dynamic Linking Bug
Date: Wed, 27 Feb 2002 11:18:40 +0100	[thread overview]
Message-ID: <012301c1bf78$20abdf40$6500a8c0@warp> (raw)

Hi all.
Here's some bug
It comes when trying to Dynlink a CMA build with flags :
> -cclib -lmylib -dllib -lmylib
(these allow static and dynamic linking)

When I compile and run a program with
> ocamlc mylib.cma myprog.ml
it works.

But when I use the following into myprog.ml ( and compile it without the
CMA )
> Dynlink.loadfile "mylib.cma"
it prints the Win32 error message "Dynamic library not found", which is
quite annoying because the name of the DLL is missing. Seems like the
dynlink_open_lib should fail with more informations (at least under Win32 :
caml_dlerror does not include the name of the module ).
So i did make it fail with the name of the library Dynlink is trying to load
, and it is "-lwin32.dll" ( seems like Dynlink doesn't like -l notation ).

Another problem with dynamic linking is that it can't be used with "-custom"
mode. When you write a DLL, you need to use caml functions to register
roots, allocations, etc... To enable access to theses functions, you need to
link with ocamlrun.lib which contains links to ocamlrun exported functions.
So when your runtime is not ocamlrun, the calls to caml functions crash. An
issue would be to have a ocamlrun.lib which links to the loading runtime. I
would be glad to know if the OCaml Team is working on that problem, or is it
"case closed" ?

Thanks

Nicolas Cannasse

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


             reply	other threads:[~2002-02-27 10:20 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-02-27 10:18 Warp [this message]
2002-03-04 19:59 ` Harry Chomsky

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='012301c1bf78$20abdf40$6500a8c0@warp' \
    --to=warplayer@free.fr \
    --cc=caml-list@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;
as well as URLs for NNTP newsgroup(s).