Version française
Home     About     Download     Resources     Contact us    
Browse thread
Error whith DynLink module
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Xavier Leroy <Xavier.Leroy@i...>
Subject: Re: Error whith DynLink module
> let load_prog name =
> 	Dynlink.init ();
> 	print_endline "OK !"; flush stdout;
> 	Dynlink.add_interfaces
> 		["Syntax"]
>       [...]
> 	with Dynlink.Error err ->
> 		print_endline (Dynlink.error_message err); false
> 
>   Zhen I execute the program, I get the following output...
> 
> OK !
> KO !
> no implementation available for Digest
> 
>   Can somenody help me ?

What about adding "Digest" to your call to Dynlink.add_interfaces?

 	Dynlink.add_interfaces ["Syntax"; "Digest"; ...] ...

Actually, you should add all standard library modules that the
dynamically-linked module might need, e.g. Pervasives, String, Char,
List, etc.

Yes, it is a pain to list them all, but for dynamic linking of
untrusted code in a secure environment (the initial application of
Dynlink), it must be done this way.

Hope this helps,

- Xavier Leroy