Hello! Been struggling with this for a while now. What I have is a C/C++ game with a build.zig that works great when built natively on windows, x86_64-linux-gnu and x86_64-macos. What I’d like to do is cross-compile my game to these platforms and others all from windows.
First up is just getting the Linux one to work, because I can use WSL to get access to the build files.
I copied the dependency libraries and headers out of my ubuntu install into a cross-compile folder.
zig build -Dtarget=x86_64-linux … builds!
I copy the binary over to the WSL machine to test and it can’t find it… come to find out it built with MUSL, not GNU, so I go back…
zig build -Dtarget=x86_64-linux-gnu … fails
The erors I get is compile-time missing symbols for _isoc23_stroll
and similar. These are defined inside zig/lib/libc but not being picked up?
So I tried building “natively” on WSL… same error. Until I apt-installed GCC, now x86_64-linux-gnu builds and runs on WSL. THis leads me to believe that there are missing system folders in my cross-compile directory.
I copied the folder that appears in WSL’s zig libc
command out, and then added exe.AddSystemLibraryPath to point to it but I get the same error.
Am I on the right track here? What am I missing?