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] lablgtk newbie question
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Benjamin Monate <monate@l...>
Subject: Re: [Caml-list] lablgtk newbie question
Richard Jones wrote:

>Why do I have to run lablgtk programs using the 'lablgtk' interpreter?
>What does this do above and beyond ordinary /usr/bin/ocaml?

It a very simple convenience wrapper which selects a good precompiled 
toplevel with Gtk initialized.

You can get rid of it :
- for programs without threads, just start
     ocaml -I +lablgtk2 lablgtk.cma gtkInit.cmo

- with threads : 
    ocaml -I +threads -I +lablgtk2 unix.cma threads.cma lablgtk.cma 
gtkThread.cmo gtkInit.cmo gtkThInit.cmo

Replace lablgtk2 by lablgtk if you are a Gtk 1.* user.

>It kind of reminds me (in a not very happy way) of the old problems
>with Tcl/Tk where you needed to use a different version of 'wish' for
>each extension you compiled in. Tell me this is not the same thing ...
This is not the same thing :-)
Moreover you may prefer to compile your programs instead of using an 
interactive toplevel.

ocamlc -I +lablgtk2 lablgtk.cma gtkInit.cmo

to produce portable bytecode or even

ocamlopt -I +lablgtk2 lablgtk.cmxa gtkInit.cmx
to produce native code.


To unsubscribe, mail Archives:
Bug reports: FAQ:
Beginner's list: