English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

Browse thread
three different labltk behaviors
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2007-08-04 (23:56)
From: Jeff Shaw <shawjef3@m...>
Subject: three different labltk behaviors
Ocaml community,
For fun I wrote a version of Life for ocaml +labltk.


Here are the 3 ways I've tried to run it and the results:

1. compile to bytecode or native:
"Fatal error: exception Protocol.TkError("Tcl/Tk not initialised")"

2. #load all the libraries into the toplevel (or give them as command 
line arguments) then #use "lifemain.ml":

3. Run the toplevel with "lifemain.ml" as an argument:
gives an empty Tk window

The results are the same on Mac OS X and Windows XP (mingw).

Here's the toplevel command:
ocaml -I +labltk -I +threads unix.cma labltk.cma threads.cma 
tkthread.cmo life.cma lifeui.cma lifemain.ml

or leave off "lifemain.ml" and do a #use "lifemain.ml".

to compile:

ocamlc -I +labltk -I +threads -o life unix.cma labltk.cma threads.cma 
tkthread.cmo life.cma lifeui.cma lifemain.ml

The sources are at


Any ideas about how to get a bytecode or native compiled version working?