Amazing project, very excited to build some apps with it! Sadly, build fails with the error below. I've installed all packages listed in the README. I searched for the error and saw a suggestion to install libgtk2.0-dev or libgtk-3-dev. Neither of these resolve the error but perhaps I'm missing something from my $PATH?
sam@sam-ThinkPad-T480s:~/revery$ esy build
info esy build 0.5.6 (using package.json)
ocamlc src/Native/dialog_gtk.o (exit 2)
(cd /home/sam/revery/_esy/default/store/b/revery-5c7dd45f/default/src/Native && /home/sam/.esy/3______________________________________________________________________/i/ocaml-4.7.1004-a6ae015e/bin/ocamlc.opt -g -I /home/sam/.esy/3______________________________________________________________________/i/opam__s__lwt-opam__c__4.1.0-62ec7e5a/lib/lwt -I /home/sam/.esy/3______________________________________________________________________/i/opam__s__ocamlfind-opam__c__1.8.0-eecbed0c/lib/bytes -I /home/sam/.esy/3______________________________________________________________________/i/opam__s__result-opam__c__1.3-1fdcd9f3/lib/result -I /home/sam/.esy/3______________________________________________________________________/i/reason_gl_matrix-0.9.9302-3a6eaf9d/lib/reglm -I /home/sam/.esy/3______________________________________________________________________/i/reason_glfw-3.2.1013-1dfe7dca/lib/reglfw -o dialog_gtk.o dialog_gtk.c)
dialog_gtk.c:2:10: fatal error: gtk/gtk.h: No such file or directory
#include <gtk/gtk.h>
^~~~~~~~~~~
compilation terminated.
error: command failed: 'dune' 'build' '--root' '.' '-j4' (exited with 1)
esy-build-package: exiting with errors above...
error: build failed with exit code: 1
esy: exiting due to errors above
@sslotsky thanks for reporting this :+1: , I recently added the initial bits for using gtk (#294)for native widgets which has gtk as a dependency. I assumed that most linux distros bundled gtk especially ubuntu which uses gnome by default :thinking:
Can I ask what happens when you run pkg-config --cflags gtk+-x11-3.0 if it prints out a list of directories do those exist if so the build should be working :face_with_head_bandage:, also installing gtk-3 didn't work?
Thanks for the reply! Looks like I get a list of directories indeed
sam@sam-ThinkPad-T480s:~/revery$ pkg-config --cflags gtk+-x11-3.0
-pthread -I/usr/include/gtk-3.0 -I/usr/include/at-spi2-atk/2.0 -I/usr/include/at-spi-2.0 -I/usr/include/dbus-1.0 -I/usr/lib/x86_64-linux-gnu/dbus-1.0/include -I/usr/include/gtk-3.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/harfbuzz -I/usr/include/pango-1.0 -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/libpng16 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include
I didn't check every folder but the first few I try certainly do
I had the same build error on Ubuntu 19.04 (also had to install libgtk-3-dev). Removing the _esy folder and then running esy install and esy build got me further.
I then got the following build error:
exp@helles ~/P/revery> esy build
info esy build 0.5.6 (using package.json)
ocamlopt examples/Examples.exe (exit 2)
(cd /home/exp/Projects/revery/_esy/default/store/b/revery-22401ec3/default && /home/exp/.esy/3______________________________________________________________________/i/ocaml-4.7.1004-a6ae015e/bin/ocamlopt.opt -w @a-4-29-40-41-42-44-45-48-58-59-60-40 -strict-sequence -strict-formats -short-paths -keep-locs -g -o examples/Examples.exe -I /home/exp/.esy/3______________________________________________________________________/i/brisk__s__brisk_reconciler-ab246a5c/lib/brisk-reconciler -I /home/exp/.esy/3______________________________________________________________________/i/flex-1.2.2-a58c3e4c/lib/flex -I /home/exp/.esy/3______________________________________________________________________/i/ocaml-4.7.1004-a6ae015e/lib/ocaml/threads -I /home/exp/.esy/3______________________________________________________________________/i/opam__s__color-opam__c__0.2.0-7db11935/lib/color -I /home/exp/.esy/3______________________________________________________________________/i/opam__s__gg-opam__c__0.9.3-203d7c78/lib/gg -I /home/exp/.esy/3______________________________________________________________________/i/opam__s__js__of__ocaml-f67c412d/lib/js_of_ocaml -I /home/exp/.esy/3______________________________________________________________________/i/opam__s__lwt-opam__c__4.1.0-62ec7e5a/lib/lwt -I /home/exp/.esy/3______________________________________________________________________/i/opam__s__lwt-opam__c__4.1.0-62ec7e5a/lib/lwt/unix -I /home/exp/.esy/3______________________________________________________________________/i/opam__s__ocamlfind-opam__c__1.8.0-eecbed0c/lib/bytes -I /home/exp/.esy/3______________________________________________________________________/i/opam__s__result-opam__c__1.3-1fdcd9f3/lib/result -I /home/exp/.esy/3______________________________________________________________________/i/opam__s__uchar-opam__c__0.0.2-835f2252/lib/uchar -I /home/exp/.esy/3______________________________________________________________________/i/reason_fontkit-2.0.6-335dcda2/lib/fontkit -I /home/exp/.esy/3______________________________________________________________________/i/reason_gl_matrix-0.9.9302-3a6eaf9d/lib/reglm -I /home/exp/.esy/3______________________________________________________________________/i/reason_glfw-3.2.1014-825c4662/lib/reglfw -I src -I src/Core -I src/Geometry -I src/Math -I src/Native -I src/Shaders -I src/UI -I src/UI_Components /home/exp/.esy/3______________________________________________________________________/i/opam__s__result-opam__c__1.3-1fdcd9f3/lib/result/result.cmxa /home/exp/.esy/3______________________________________________________________________/i/opam__s__lwt-opam__c__4.1.0-62ec7e5a/lib/lwt/lwt.cmxa /home/exp/.esy/3______________________________________________________________________/i/opam__s__js__of__ocaml-f67c412d/lib/js_of_ocaml/js_of_ocaml.cmxa /home/exp/.esy/3______________________________________________________________________/i/ocaml-4.7.1004-a6ae015e/lib/ocaml/str.cmxa /home/exp/.esy/3______________________________________________________________________/i/ocaml-4.7.1004-a6ae015e/lib/ocaml/unix.cmxa /home/exp/.esy/3______________________________________________________________________/i/ocaml-4.7.1004-a6ae015e/lib/ocaml/bigarray.cmxa /home/exp/.esy/3______________________________________________________________________/i/ocaml-4.7.1004-a6ae015e/lib/ocaml/threads/threads.cmxa /home/exp/.esy/3______________________________________________________________________/i/opam__s__lwt-opam__c__4.1.0-62ec7e5a/lib/lwt/unix/lwt_unix.cmxa /home/exp/.esy/3______________________________________________________________________/i/reason_gl_matrix-0.9.9302-3a6eaf9d/lib/reglm/reglm.cmxa /home/exp/.esy/3______________________________________________________________________/i/reason_glfw-3.2.1014-825c4662/lib/reglfw/reglfw.cmxa /home/exp/.esy/3______________________________________________________________________/i/opam__s__gg-opam__c__0.9.3-203d7c78/lib/gg/gg.cmxa /home/exp/.esy/3______________________________________________________________________/i/opam__s__color-opam__c__0.2.0-7db11935/lib/color/color.cmxa /home/exp/.esy/3______________________________________________________________________/i/flex-1.2.2-a58c3e4c/lib/flex/Flex.cmxa /home/exp/.esy/3______________________________________________________________________/i/reason_fontkit-2.0.6-335dcda2/lib/fontkit/fontkit.cmxa src/Core/Revery_Core.cmxa src/Math/Revery_Math.cmxa src/Shaders/Revery_Shaders.cmxa src/Geometry/Revery_Geometry.cmxa /home/exp/.esy/3______________________________________________________________________/i/brisk__s__brisk_reconciler-ab246a5c/lib/brisk-reconciler/brisk_reconciler.cmxa src/UI/Revery_UI.cmxa src/UI_Components/Revery_UI_Components.cmxa src/Native/Revery_Native.cmxa src/Revery.cmxa examples/.Examples.eobjs/Border.cmx examples/.Examples.eobjs/Boxshadow.cmx examples/.Examples.eobjs/Calculator.cmx examples/.Examples.eobjs/CheckboxExample.cmx examples/.Examples.eobjs/DefaultButton.cmx examples/.Examples.eobjs/Flexbox.cmx examples/.Examples.eobjs/Focus.cmx examples/.Examples.eobjs/GameOfLife.cmx examples/.Examples.eobjs/Hello.cmx examples/.Examples.eobjs/InputExample.cmx examples/.Examples.eobjs/Native.cmx examples/.Examples.eobjs/RadioButtonExample.cmx examples/.Examples.eobjs/ScreenCapture.cmx examples/.Examples.eobjs/ScrollView.cmx examples/.Examples.eobjs/Slider.cmx examples/.Examples.eobjs/Stopwatch.cmx examples/.Examples.eobjs/TreeView.cmx examples/.Examples.eobjs/Examples.cmx)
/usr/bin/ld: //lib/x86_64-linux-gnu/libpangoft2-1.0.so.0: undefined reference to `hb_glib_script_from_script'
/usr/bin/ld: //lib/x86_64-linux-gnu/libpangoft2-1.0.so.0: undefined reference to `hb_glib_script_to_script'
collect2: error: ld returned 1 exit status
File "caml_startup", line 1:
Error: Error during linking
error: command failed: 'dune' 'build' '--root' '.' '-j4' (exited with 1)
esy-build-package: exiting with errors above...
error: build failed with exit code: 1
esy: exiting due to errors above
which was fixed by removing ~/.esy and running esy install and esy build. Now the project builds correctly.
@sslotsky did you have a chance to try out @expe's solution of clearing the _esy directory and rerunning the esy command?
Ahhh, sorry for the delay on this! I just now tried it and yes, it worked! :fire: :fire: :fire:
Thanks so much for finding and sharing this workaround @expe !!
Nice :+1: closing this as there's a solution and the issue was resolved
@Akin909 I think this solution https://github.com/revery-ui/revery/issues/316#issuecomment-462505096 should be documented, also libgtk-3-dev added to Debian/Ubuntu dependencies
https://github.com/revery-ui/revery/pull/345 <- this is also an issue for ubuntu <=18.04.
I'll document it in the readme.
Most helpful comment
I had the same build error on Ubuntu 19.04 (also had to install libgtk-3-dev). Removing the
_esyfolder and then runningesy installandesy buildgot me further.I then got the following build error:
which was fixed by removing
~/.esyand runningesy installandesy build. Now the project builds correctly.