I played with the following glade example files from LablGtk2:
You can find them from the liblablgtk2-ocaml-dev package if you are using Debian Gnu/Linux Sid.
To run the gladecalc.ml you should do the following first:
lablgladecc2 -embed project2.glade > project2.ml
then you can run gladecalc.ml:
lablgtk2 -thread gladecalc.ml
This might not be very useful if you want to deploy your own LablGtk2 applications and the clients don't have OCaml toplevel installed: lablgtk2 is just a shell script wrapped around OCaml toplevel after all.
In our case, to compile gladecalc.ml into a native executable, we should first change the code a little bit. The #use directive in line 6 of gladecalc.ml works only for OCaml toplevel, so comment it out and add a new line:
(* #use "project2.ml";; *) open Project2
then use ocamlopt to compile:
ocamlopt -I +lablgtk2 lablgtk.cmxa lablglade.cmxa gtkInit.cmx project2.ml gladecalc.ml -o gladecalc
this produces a single executable "gladecalc" without OCaml dependencies.