1

I'm having trouble installing lablgtk in order to create a GUI for my Ocaml program. Not only am I finding the instructions on the site difficult to follow but I am having trouble finding the packages online to download; my browser is blocking most of the sites as it says they are dangerous.

What is the easiest, most straightforward way to download and install lablgtk?

anol
  • 8,264
  • 3
  • 34
  • 78
user1959309
  • 101
  • 1
  • 11
  • Just a remark, lablgtk is still one of the most reliable ways to develop cross-OS GUIs in OCaml, but it is (as far as I know) no longer actively developed. It is still well maintained and patched regularly, but shouldn't have new features (such as Gtk3). For a mid- to long-term project, I would recommend another framework. If it's mostly for learning or for a small code base, however, lablgtk should be fine. – anol Mar 30 '16 at 16:19

1 Answers1

2

You can follow Jonathan's instructions [1] and install opam with depext cygwin [2]. Then it should be easy to install lablgtk2 on Windows.

Çağdaş Bozman
  • 2,537
  • 16
  • 21
  • 1
    Yes, lablgtk can be installed with https://fdopen.github.io/opam-repository-mingw/ and `opam install depext depext-cygwinports && opam depext -i lablgtk`. But don't use http://protz.github.io/ocaml-installer/. It's not fully compatible with https://fdopen.github.io/opam-repository-mingw/ – rafix Mar 29 '16 at 12:10
  • Thank you both for your response. I am definitely on the right track now, though I am having a problem with GTK+. When Cygwin starts to install lablgtk, I eventually get an error saying "GTK+ is required". The troubleshooting says "This package requires gtk+ 2.0 development packages installed on your system". I have now installed libgtk2.0-devel and libgtk2.0_0 by re-running the Cygwin setup (setup-x86.exe), but I get the same error when I try to install lablgtk again. The cygwin64 folder in my directory contains a folder "gtk-2.0" in the "lib" folder. I'm not sure which step to take next. – user1959309 Mar 30 '16 at 12:30
  • 1
    I had a similar issue which was due to `pkg-config`. You have to install pkg-config and set the variable `PKG_CONFIG_PATH` to something like `/usr/x86_64-mingw32/sys-root/mingw/pkgconfig`. – Çağdaş Bozman Mar 30 '16 at 13:00
  • I am wondering if my issue is that pkg-config isn't installed correctly. Every time I try to install lablgtk, Cygwin first outputs the following `# The following system packages are needed: # - gtk2.0 # - pkg-config installed:gtk2.0 installed:pkg-config` Then when it fails it outputs this: `[ERROR] The compilation of lablgtk failed at "./configure --prefix C:/Users/myname/Documents/.opam/4.02.3+mingw64c LABLGLDIR=C:/Users/myname/Documents/.opam/4.02.3+mingw64c/lib/lablgl".` – user1959309 Mar 31 '16 at 00:36
  • 1
    You have to install depext-cygwinports (as mentioned above). It will install a wrapper for pkg-config, setting PKG_CONFIG_PATH should not be necessary. And you have to add /usr/x86_64-w64-mingw32/sys-root/mingw/bin to your PATH ( as mentioned here https://github.com/fdopen/opam-repository-mingw/#things-to-remember or in the output of `opam install depext depext-cygwinports` ) – rafix Mar 31 '16 at 12:57
  • I followed rafix's suggestion of adding to the PATH. It has successfully installed, now I just need to test that it runs as expected. Thank you all for your advice! – user1959309 Apr 02 '16 at 21:23