#Zig for cross-compiling Go+CIMGUI

1 messages · Page 1 of 1 (latest)

jolly sparrow
#

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:

#

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

stiff wasp
#

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)

wraith kelp