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 RAA04992; Fri, 16 Apr 2004 17:22:57 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id RAA03614 for ; Fri, 16 Apr 2004 17:22:56 +0200 (MET DST) Received: from smtp005.mail.ukl.yahoo.com (smtp005.mail.ukl.yahoo.com [217.12.11.36]) by nez-perce.inria.fr (8.12.10/8.12.10) with SMTP id i3GFNxjq009317 for ; Fri, 16 Apr 2004 17:23:59 +0200 Received: from unknown (HELO yahoo.it) (pasckosky2000@213.255.109.130 with plain) by smtp005.mail.ukl.yahoo.com with SMTP; 16 Apr 2004 15:22:54 -0000 Message-ID: <407FFA81.7000307@yahoo.it> Date: Fri, 16 Apr 2004 17:23:45 +0200 From: Luca Pascali User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040113 X-Accept-Language: en-us, en MIME-Version: 1.0 To: ocaml ml Subject: [Caml-list] Dynlink and unsafe modules Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Miltered: at nez-perce by Joe's j-chkmail ("http://j-chkmail.ensmp.fr")! X-Loop: caml-list@inria.fr X-Spam: no; 0.00; dynlink:01 dynlink:01 statically:01 dynamically:01 dynamically:01 loadfile:01 cmo:01 unsafe:01 unsafe:01 exception:02 exception:02 linking:02 modules:02 modules:02 unix:02 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Hi to the whole team. I'm having a little trouble using Dynlink module: I have created a binarycode library (.cma file) that contains some functions I need in the application. By statically linking this library to the executable I do not get any error, all works fine and I can use this library. What I want (or I should say "what I would like") to do is to dynamically link this library to the executable. I would like to say that no other module in the executable refers to the library. Library functions are referred by binarycode objects (.cmo files) dynamically loaded on request. Now calling the Dynlink.loadfile function on the library filename (after the Dynlink.init ()) I get the following exception: Dynlink.Error("this object file uses unsafe features") What does it mean? Which kind of mistake I can have done in the library source that can bring to this error? At what kind of mistakes I should pay attention when I work with the Dynlink module? I tried also to call the Dynlink.allow_unsafe_modules true function to bypass the problem that rises the exception. What I got is that I didn't get this exception, but I got troubles with a simple function in witch I use the stat of Unix in a try ... with ... clause. This try/with failed to recognise the Unix.Error (Unix.NOENT,_) execption. If I do not call the Dynlink.allow_unsafe_modules true function, this try/with does not fails. Thanks in advance to everyone can help me. Luca Pascali ------------------- 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