go-gl / glfw

Go bindings for GLFW 3
BSD 3-Clause "New" or "Revised" License
1.56k stars 182 forks source link

v3.3: Wayland compile on OpenSUSE fails #402

Open Jacalz opened 2 months ago

Jacalz commented 2 months ago

I installed OpenSUSE Leap 5.6 recently and tried to build for Wayland but this resulted in the following compilation error:

image

This issue seems to come from the fact that OpenSUSE installs their Wayland headers into /usr/include/wayland, i.e. in a subdirectory compared to Fedora that places their libraries directly into the /usr/include folder.

image

maximiliankolb commented 1 month ago

I believe that I have a reproducer on Fedora 40 using go 1.22.5:

$ go run fyne.io/fyne/v2/cmd/fyne_demo@latest
# github.com/go-gl/glfw/v3.3/glfw
In file included from ./glfw/src/internal.h:188,
                 from ./glfw/src/context.c:30,
                 from ../../go/pkg/mod/github.com/go-gl/glfw/v3.3/glfw@v0.0.0-20240506104042-037f3cc74f2a/c_glfw.go:4:
./glfw/src/x11_platform.h:36:10: fatal error: X11/Xcursor/Xcursor.h: No such file or directory
   36 | #include <X11/Xcursor/Xcursor.h>
      |          ^~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Jacalz commented 1 month ago

@maximiliankolb I don't think so. First of all, contrary to this issue, you are compiling with X11 and not Wayland so it is not the same issue. Secondly, I've also been doing all my development on Fedora for multiple years at this stage without issues. The most likely culprit is missing dependencies. Have you followed the steps at https://docs.fyne.io/started/?