I am truying to install Gtk and use it with Ocaml (lablgtk) on Windows (the Diskuv package).The GTK Project - A free and open-source cross-platform widget toolkit proposes me to use MSYS2 and pacman to install mingw-w64-x86_64-gtk3
. I had to install mingw-w64-x86_64-pkg-config
too. And add the \MSYS64\mingw64\bin to the PATH.
Now, opam install lablgtk3
… And I have the error :
#=== ERROR while compiling cairo2.0.6.2 =======================================#
# context 2.2.0~alpha~dev | win32/x86_64 | ocaml-system.4.12.1 | pinned(https://github.com/Chris00/ocaml-cairo/releases/download/0.6.2/cairo2-0.6.2.tbz)
# path C:\Users\frede\AppData\Local\opam\playground\.opam-switch\build\cairo2.0.6.2
# command C:\Users\frede\AppData\Local\Programs\DISKUV~1\0\dkml\_opam\bin\with-dkml.exe dune build -p cairo2 -j 7
# exit-code 1
# env-file C:\Users\frede\AppData\Local\opam\log\cairo2-10080-f346a0.env
# output-file C:\Users\frede\AppData\Local\opam\log\cairo2-10080-f346a0.out
### output ###
# cl src/cairo_stubs.obj (exit 2)
# (cd _build/default/src && C:\DiskuvOCaml\BuildTools\VC\Tools\MSVC\14.26.28801\bin\HostX64\x64\cl.exe -nologo -O2 -Gy- -MD -D_CRT_SECURE_NO_DEPRECATE -nologo -O2 -Gy- -MD -Id:/msys64/mingw64/include -Id:/msys64/mingw64/include/freetype -Id:/msys64/mingw64/lib/glib-2.0/include -Id:/msys64/mingw64/lib/glib-2.0/include/freetype -Id:/msys64/mingw64/include/glib-2.0 -Id:/msys64/mingw64/include/glib[...]
# cairo_stubs.c
# C:\Users\frede\AppData\Local\opam\playground\.opam-switch\build\cairo2.0.6.2\_build\default\src\cairo_macros.h(178): error C2010: '.' : inattendu dans la liste de paramètres de macro
# cairo_stubs.c(1615): error C2010: '.' : inattendu dans la liste de paramètres de macro
I guess I shouldn’t use a Visual C based distribution which doesn’t understand the (args ...)
syntax with #define
. But Diskuv seems (now) to be the priviledged distribution for Windows. Will OCaml 5 + opam 2.2 will switch the C-toolchain ?
With opam install lablgtk
, it is weirder :
=> This package requires gtk+ 2.0 development packages installed on your system
.
However, the gtk+ -2.0 is well installed. pkg-config
prints :
gtk+-2.0 GTK+ - GTK+ Graphical UI Library (win32 target)
.