Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
[Caml-list] Dynlink and unsafe modules
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Richard Jones <rich@a...>
Subject: Re: [Caml-list] Dynlink and unsafe modules
On Fri, Apr 16, 2004 at 05:23:45PM +0200, Luca Pascali wrote:
> 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")

This simply means that the library or module you are trying to load
does some unsafe stuff - typically it was compiled with the "-unsafe"
option to turn off bounds checking, or else it contains C code.

Try using the ocamlobjinfo (sometimes called objinfo) command to
display the internal structure of the library / module that you are
trying to load.

> 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.

Can you post a test case where this fails?


Richard Jones.
Merjis Ltd. - improving website return on investment
If I have not seen as far as others, it is because I have been
standing in the footprints of giants.  -- from Usenet

To unsubscribe, mail Archives:
Bug reports: FAQ:
Beginner's list: