Hello, I have built an internal tool for my business and I would like to have a MacoS linux and windows build, in order to make it available to potentially everyone within our workplace.
This tool is made with Go+IMGUI, Since it is easier to write business logic and not care about allocations and stuff...
Now I would like to cross-compile it by exploiting the Zig toolchain, but there are some Errors:
#Zig for cross-compiling Go+CIMGUI
1 messages · Page 1 of 1 (latest)
with this make.sh
CGO_ENABLED=1 \
GOOS=linux \
GOARCH=amd64 \
CC="zig cc -target x86_64-linux-gnu -isystem /usr/include -L/usr/lib/x86_64-linux-gnu" \
CXX="zig c++ -target x86_64-linux-gnu -isystem /usr/include -L/usr/lib/x86_64-linux-gnu" \
go build -trimpath -o linux-amd64 ./...
I get:
warning: unknown warning option '-Wno-changes-meaning' [-Wunknown-warning-option]
In file included from glfw_backend.cpp:9:
../../../../go/pkg/mod/github.com/!allen!dang/[email protected]/thirdparty/glfw/include/GLFW/glfw3.h:241:12: fatal error: 'GL/gl.h' file not found
#include <GL/gl.h>
^~~~~~~~~
1 warning and 1 error generated.
I have no clue on how to fix it
ah yes
I'm not familiar with your toolchain, but that's cimgui throwing because you're trying to compile against imgui's glfw backend but it can't actually find glfw
actually no -- it has glfw, but it's complaining that it can't find opengl
I mean, do you have the opengl headers installed on your build machine?
(this doesn't look like a problem that is zig related)
Have a look into how fyne (another go gui toolkit) uses zig to handle the cgo cross compilation.
https://fynelabs.com/2023/03/30/the-new-fyne-cross-puts-geoffrey-on-a-rocket/