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 (00:13)
From: Stéphane Glondu <steph@g...>
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). [...]

This is a problem I faced myself. My advice is to make sure some module
is not linked twice in an executable. For this, I build a .cma with the
same objects as the executable (basically, add -a to the final linking
stage), and run ocamlobjinfo on the .cma.

Sometimes, it is not up to you. See for example:

> [...]
> (I ran into this trying to use the ocaml-ssl module, which for some
> reason builds unix.cma into ssl.cma.)

I've also noticed this and submitted a patch upstream for this.


Stéphane Glondu