ocamllablgtkocaml-dune

Unable to build a program using lablgtk2 with jbuilder


I would like to use jbuilder when compiling with lablgtk2 but I am having problems getting these error messages:

File "_none_", line 1:
Error: No implementations provided for the following modules:
         Thread referenced from /Users/hadilsabbagh/.opam/4.05.0/lib/lablgtk2/gtkThread.cmx
         Mutex referenced from /Users/hadilsabbagh/.opam/4.05.0/lib/lablgtk2/gtkThread.cmx
         Condition referenced from /Users/hadilsabbagh/.opam/4.05.0/lib/lablgtk2/gtkThread.cmx

Here is my jbuild:

(jbuild_version 1)

(executable
  ((name simple)
  (libraries (lablgtk2))
  ))

Solution

  • Most likely, your jbuild is missing a dependency on core (due to gtkThread.cmx) , it should work with the follwing jbuild file :

    (jbuild_version 1)
    
    (executable
      ((name simple)
      (libraries (core lablgtk2))
      ))