Version française
Home     About     Download     Resources     Contact us    
Browse thread
Tutorial example for nat dynlink
[ 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: [Caml-list] Tutorial example for nat dynlink
Hello Yves,

> I have been trying to build a small example "hello world" program
> using native dynlink, but I don't manage to make it work.  Could
> please send me some advice?

The issue here is that when Dynlink.loadfile is called, module Toto is
not yet completely evaluated, therefore it is not yet visible to
dynamically-loaded code.  The solution is just to split your main
program in two modules: Toto containing what your plugin needs to see,
and Totomain performing the dynlink.  Then, it'll work just fine.

Cheers,

- Xavier