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
linking the same module more than once
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2008-08-08 (06:13)
From: Alain Frisch <alain@f...>
Subject: Re: [Caml-list] linking the same module more than once
Jake Donham wrote:
> There is no trouble linking a module more than once, but different
> parts of the code can wind up linked to different instances of the
> module, leading to the confusing behavior that exception handling
> seems not to work (and generally that things you think are equal are
> not).

You should really avoid linking two modules with the same name. This can 
lead to all kind of errors and the compiler will not always catch you if 
they have the same signature. You can even break type safety by linking 
two modules with the same name and signature but with different 

- without Dynlink:
(quite simple with ocaml; more difficult with ocamlopt, but still 
possible with -pack)

- with Dynlink:

-- Alain