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] Ocamlmakefile and Lablgtk
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2001-11-14 (14:20)
From: Markus Mottl <markus@o...>
Subject: Re: [Caml-list] Ocamlmakefile and Lablgtk
On Wed, 14 Nov 2001, Jacques Garrigue wrote:
> From: Markus Mottl <>
> > But why not just link the module in the right order with the rest of
> > the library? Then things will be initialized as required. Or are there
> > circumstances where you don't want initialization?
> This is exactly the reason.
> Take for instance Unison. It is linked with lablgtk, but does not want
> to initialize GTK+ when used in text mode. This is very important,
> otherwise you would need an X-server running everytime you start
> Unison.

Ok, I see, I didn't know what kind of initializations have to be

> While Unison was the original reason, I think it is indeed good
> practice to initialize by hand, without linking gtkInit.cmo.

I agree.

> So the rule of the thumb is: use gtkInit.cmo if you are developping
> with the toplevel and all your program is included in one file, but
> switch to explicit initialization as soon as it gets bigger. This way,
> OCamlMakefile should not be a problem :-)

OCamlMakefile respects the order of files as defined by the user to
exactly avoid this problem of initialization order in the presence of
side effects. So blaming OCamlMakefile for wrong linking order is not
an excuse :-)

Markus Mottl

Markus Mottl                                   
Austrian Research Institute
for Artificial Intelligence        
Bug reports:  FAQ:
To unsubscribe, mail  Archives: