I’m trying to test out the webviews in the new JUCE branch on linux mint, but I’m running into trouble with the compilation stage in cmake not finding my gtk installation. This only happens when I set the flag JUCE_WEB_BROWSER=1, which I believe is required for me to start using the WebComponents (according to the tutorial I’m following).
I’ve installed both the latest versions of gtk (gtk-4) as well as the earlier version gtk-3, and they’re both present in my /usr/include folder. Despite this, these gtk installations still can’t be found.
Is there a way in cmake to link the gtk headers within the build process, or is there a more obvious solution to this?
Gtk should just simply install with apt. If you can’t find the right package, maybe try the libgtk-3-dev one (I’m not sure if it will work, but it seems like it).
If you have problems with libwebkit2gtk-4.0, check this issue out. The workaround from the “Workaround” section worked for me.
As per the document linked above, the current recommendation is to install libwebkit2gtk-4.1, but libwebkit2gtk-4.0 will work too, in case the distro is only providing that.
libwebkit2gtk-4.1 didn’t work for me on the newest Ubuntu. Linux Mint is Ubuntu-based so there is quite a big chance that the poster will need to install libwebkit2gtk-4.0 instead of 4.1.
Don’t forget, Debian users, that if you get into problems with compile sessions not finding headers that are expected, you can use the ‘apt-file’ program to find out which specific package on your system provides that file, e.g.:
$ apt-file search gtk.h
… this will show you which packages have the ‘gtk.h’ header included in your system.
Many a frustrating compile has been avoided by using apt-file (which must be ‘apt-file update’-ed after install, don’t forget) to find the right package containing the needed header …
Hmm I tried to build a project I and added this to every juce_add_<...> call I could find, but it still can’t find the GTK header … is there another way around it?