1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
|
Here is a small howto about installing LablGtk2 on Win32
Binary installation
0) Both MSVC and mingw versions of ocaml 3.09 should work.
1) Install the gtk2 libraries and dependencies. You can find them
in a single zip file gtk-2.6.8-win32-dlls.zip at
http://wwwfun.kurims.kyoto-u.ac.jp/soft/olabl/lablgtk.html
The corresponding bin directory must be in your path, and other
directories should not be moved relatively to bin.
2) Install lablgtk2 binaries and scripts inside the OCaml distribution
bin/lablgtk2.bat -> bin
lib/stublibs/dlllablgtk2.dll -> lib/stublibs
lib/lablgtk2 -> lib/lablgtk2
3) Go to the lib/lablgtk2 directory and execute
ocaml build.ml
This will compile the ocaml part of the library (the C part is
already compiled.) Note that the autodection for mingw is not
fool-proof (lablgtk2 has to be installed directly under the ocaml
library), so if the OCaml port annouced by build.ml is not the
right one, you should specify it by hand inside build.ml.
You must repeat this compilation step every time you upgrade OCaml.
4) Test in examples
lablgtk2.bat testgtk.ml
See also the "Windows port" section of the main LablGtk2 README for
important remarks on threads on Windows.
5) For custom linking or native code, you must also have the export
libraries corresponding to your GTK DLLs (see below for where to
find them.) There is not default place to put them, so you should
specify that at link time:
ocamlopt -custom -ccopt "/link /libpath:/home/garrigue/gtk-2.6.8/lib"
-I +lablgtk2 lablgtk.cmxa gtkInit.cmx testgtk.ml -o testgtk.exe
or, on Mingw
ocamlopt -custom -ccopt "-L/home/garrigue/gtk-2.6.8/lib" -I +lablgtk2 \
lablgtk.cmxa gtkInit.cmx testgtk.ml -o testgtk.exe
Full compilation (for the brave)
0) You will need either the MSVC or mingw version of ocaml 3.07 or more,
and cygwin development tools. If you use mingw, check your
installation by trying to compile a hello world C program with
gcc -mno-cygwin -mms-bitfields main.c
1) Install Gtk 2: use the precompiled binaries available at
http://www.gimp.org/~tml/gimp/win32/downloads.html
Do NOT even try to compile it yourself from scratch.
You need to install :
-libiconv
-libintl
-gettext-dev
-glib-2.2.1 runtime+dvel
-pkgconfig
-zlib libpng libjpeg libtiff freetype runtime+devel
-gtk+-2.2.1 runtime+dev
-atk-1.03 runtime+dev
-pango-1.2.1 runtime+dev
Unzip all these in the base directory (something like X:\cygwin\ )
Try to compile a small hello-gtk.c (see the tutorial page on
http://www.gtk.org) before going further.
3) If you are using mingw, "./configure" should succeed. (Well not for me...)
For MSVC, copy config.make.nt to config.make, and edit it to set GTKROOT.
4) Simply do "make" and "make opt" for the native version.
5) Install ("make install") and test.
$Id: README.win32,v 1.5 2005/10/27 00:44:49 garrigue Exp $
|