missing pkg 'xorg-dev' for example/glfw

hi team,

I just pull gio repo and played with examples, on Debian 10, login with Wayland but not X11, it seems that, example/glfw still need "xorg-dev " under wayland, here is the print:

fino@OP7071DE:/work/gioui/gio/example/glfw$ go run main.go go: downloading github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1 go: downloading github.com/go-gl/gl v0.0.0-20190320180904-bf2b1f2f34d7 go: downloading github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72


In file included from ./glfw/src/internal.h:187, from ./glfw/src/context.c:30, from /home/fino/go/pkg/mod/github.com/go-gl/glfw/v3.3/glfw@v0.0.0-20191125211704-12ad95a8df72/c_glfw.go:4: ./glfw/src/x11_platform.h:36:10: fatal error: X11/Xcursor/Xcursor.h: No such file or directory #include <X11/Xcursor/Xcursor.h> ^~~~~~~~~~~~~~~~~~~ compilation terminated.

issue fixed by: sudo apt install xorg-dev

BR / Fino Meng (孟祥夫) Intel – IOTG Developer Enabling

Meng, Fino
Assigned to
3 months ago
3 months ago
No labels applied.

~eliasnaur 3 months ago

Thank you for the report.

The compilation error doesn't seem to be a bug in Gio, but rather in GLFW. Note that glfw is not required for regular Gio programs; rather, the glfw example is specifically for demonstrating integration of Gio with external frameworks.

Gio programs does have a similar problem (both X11 and Wayland libraries are linked in at build time), which can be worked around with -tags=nox11. Note that neither Wayland nor X11 is a runtime dependency; an appropriate backend is selected at runtime.

In other words: what is the expected behaviour?

Meng, Fino 3 months ago · edit


Not big deal just a little bit confuse for new comers.

Maybe put a build.sh in the dir for convenience?

I don't know; I just feel people today don't read document before trying😊

BR / Fino (孟祥夫)

Intel – IOTG Developer Enabling

~eliasnaur 3 months ago

What would the build.sh contain? Your apt-get install line is not portable across distributions. FWIW, the requirements are documented at https://gioui.org/doc/install, but I agree that few people (not including me!) read instructions.

Register here or Log in to comment, or comment via email.