raylib-go icon indicating copy to clipboard operation
raylib-go copied to clipboard

Can't run without Xinerama

Open denisstrizhkin opened this issue 1 year ago • 2 comments
trafficstars

I am using Wayland primarily so I am missing some X11 dependencies. You can compile Raylib without X11 though as it runs just fine for me with X11 disabled. Can the same be done for Go bindings?

# github.com/gen2brain/raylib-go/raylib
warning: unknown warning option '-Wno-stringop-overflow'; did you mean '-Wno-shift-overflow'? [-Wunknown-warning-option]
In file included from ../../../go/pkg/mod/github.com/gen2brain/raylib-go/[email protected]/cgo_linux.go:7:
In file included from ./external/glfw/src/context.c:28:
In file included from ./external/glfw/src/internal.h:325:
In file included from ./external/glfw/src/platform.h:81:
./external/glfw/src/x11_platform.h:45:10: fatal error: 'X11/extensions/Xinerama.h' file not found
   45 | #include <X11/extensions/Xinerama.h>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~
1 warning and 1 error generated.

denisstrizhkin avatar Aug 07 '24 07:08 denisstrizhkin

I think this could be solved by adding wayland build tag that would compile without X11 enabled

denisstrizhkin avatar Aug 07 '24 07:08 denisstrizhkin

There was already a wayland build tag because GLFW supported either one or another, with the latest changes it is possible to have the same binary that works on both Wayland and X11 and it will choose it on runtime. That is the default and the preferred way, not sure why someone would prefer again different binaries for one or another, but I agree that the option would be nice, if possible. I will check this after the summer is over. You also have the option to use SDL instead of GLFW.

gen2brain avatar Aug 07 '24 11:08 gen2brain

Build tag wayland is added in https://github.com/gen2brain/raylib-go/commit/5df9325f630425b9d52ddabb86b8e08c2f7ea317.

gen2brain avatar Dec 03 '24 07:12 gen2brain