From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id LAA28753; Wed, 27 Feb 2002 11:20:30 +0100 (MET) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f 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 LAA29454 for ; Wed, 27 Feb 2002 11:20:29 +0100 (MET) Received: from relay-1m.club-internet.fr (relay-1m.club-internet.fr [195.36.216.170]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id g1RAKTv27658 for ; Wed, 27 Feb 2002 11:20:29 +0100 (MET) Received: from warp (lns02m-11-186.w.club-internet.fr [212.194.22.186]) by relay-1m.club-internet.fr (Postfix) with SMTP id 42B7D1715 for ; Wed, 27 Feb 2002 11:20:27 +0100 (CET) Message-ID: <012301c1bf78$20abdf40$6500a8c0@warp> From: "Warp" To: "OCaml" Subject: [Caml-list] Dynamic Linking Bug Date: Wed, 27 Feb 2002 11:18:40 +0100 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.50.4133.2400 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk 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