andrewrk / sdl-zig-demo

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

Unable to "zig build run" on Windows 10 #3

Closed argontus closed 5 years ago

argontus commented 5 years ago

zig build works fine, but zig build run causes a pretty nondescriptive error:

C:\projects\sdl-zig-demo-master>zig build run
The following command exited with error code -1073741515:
cd C:\projects\sdl-zig-demo-master && zig-cache\sdl-zig-demo.exe

Build failed. The following command failed:
C:\Users\argontus\AppData\Local\zig\stage1\artifact\4iEWQpbmq9mZd9UnLBfxC-Meu1JzUydrqNVBB9CYkAZfVcX-98ag8yI8ap4AweG9\build.exe C:\Users\argontus\.zig\zig.exe C:\projects\sdl-zig-demo-master C:\projects\sdl-zig-demo-master\zig-cache run 

Seems that the command fails as soon as any function declared in SDL.h is called.

EDIT: User error, turns out I misunderstood how linkSystemLibrary works and failed to manually copy SDL2.dll into zig-cache directory. Doing this solved the issue.