andrewrk / sdl-zig-demo

SDL2 hello world in zig
MIT License
116 stars 20 forks source link

'build-exe' silently fails on Windows 10 #6

Closed ghost closed 4 years ago

ghost commented 4 years ago

Running zig.exe build-exe src/main.zig --library SDL2 --library c --cache-dir zig-cache --name sdl-zig-demo --cache on on Windows 10 fails without any error. Error level is being set to 5.

EDIT: Running zig.exe build run with fixes proposed in PR#5 produces the following error message:

sdl-zig-demo...The following command exited with error code 5:
C:\dev\tools\zig\zig.exe build-exe C:\dev\home\sdl-zig-demo\src\main.zig --library SDL2 --library c --cache-dir C:\dev\home\sdl-zig-demo\zig-cache --name sdl-zig-demo --cache on

Build failed. The following command failed:
C:\dev\home\sdl-zig-demo\zig-cache\o\TbPpDhWzKZpDK8Ivf8V_CBWD7b3sAj64oUXfVFB6ytmlDvnPrOduzc20uYiUWXTT\build.exe C:\dev\tools\zig\zig.exe C:\dev\home\sdl-zig-demo C:\dev\home\sdl-zig-demo\zig-cache run

EDIT 2: This seems to relate to some breaking change in current Zig master code. Zig 0.6 seems to be able to build this on Windows.

ghost commented 4 years ago

This seems to have been fixed in the most recent master release of Zig.

I would like to note that in order for this to work on Windows, you have to put SDL2.dll in the root of the repo. Otherwise, the build fails silently.