Hello everyone. I'm trying to cross compile from Linux to Windows, but I'm having issues importing the Windows header:
install
└─ install zig-linux-windows
└─ zig build-exe zig-linux-windows Debug x86_64-windows-msvc 2 errors
src/main.zig:1:17: error: C import failed
const windows = @cImport({
^~~~~~~~
referenced by:
main: src/main.zig:6:5
callMain: /usr/lib/zig/std/start.zig:511:32
remaining reference traces hidden; use '-freference-trace' to see all reference traces
/home/fox/Documents/Code/zig-linux-windows/zig-cache/o/99216ed7f9b7bae2e006adb4834b379a/cimport.h:1:10: error: 'Windows.h' file not found
#include <Windows.h>
^
error: the following command failed with 2 compilation errors:
/usr/bin/zig build-exe -ODebug -target x86_64-windows-msvc -mcpu baseline -Mroot=/home/fox/Documents/Code/zig-linux-windows/src/main.zig -lc --cache-dir /home/fox/Documents/Code/zig-linux-windows/zig-cache --global-cache-dir /home/fox/.cache/zig --name zig-linux-windows --listen=-
Build Summary: 0/3 steps succeeded; 1 failed (disable with --summary none)
install transitive failure
└─ install zig-linux-windows transitive failure
└─ zig build-exe zig-linux-windows Debug x86_64-windows-msvc 2 errors
error: the following build command failed with exit code 1:
/home/fox/Documents/Code/zig-linux-windows/zig-cache/o/39717c83fd6ea5ab5c327375b6a2d9b8/build /usr/bin/zig /home/fox/Documents/Code/zig-linux-windows /home/fox/Documents/Code/zig-linux-windows/zig-cache /home/fox/.cache/zig --seed 0xa3efff9b -Z2149fe5ce863e078
I'm not sure why this is happening, as I've linked libc to the executable.