You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Windows build fails on Zig 0.17.0-dev.667+0569f1f6a due to unused config header values #22
On Windows, building this package with newer Zig master fails during SDL_build_config.h generation because the Windows config helper provides several values that are not present in upstream SDL 3.4.4's SDL_build_config.h.cmake.
This appears to be exposed by newer Zig versions being stricter about unused addConfigHeader values.
Platform
Windows x86_64
Zig versions tested
Works:
0.16.0
0.17.0-dev.101+4e2147d14
Fails:
0.17.0-dev.667+0569f1f6a
0.17.0-dev.263+0add2dfc4
Error
└─ compile lib SDL3 Debug native
└─ configure cmake header dependency to SDL_build_config.h failure
error: C:\Repositories\sdl-build-failure-test\zig-pkg\N-V-__8AAL9L9AJxY67Fhxp52_VHlLps195MF3irmi4z8Qge\include/build_config/SDL_build_config.h.cmake: config header value unused: HAVE_D3D11_H
error: C:\Repositories\sdl-build-failure-test\zig-pkg\N-V-__8AAL9L9AJxY67Fhxp52_VHlLps195MF3irmi4z8Qge\include/build_config/SDL_build_config.h.cmake: config header value unused: HAVE_AUDIOCLIENT_H
error: C:\Repositories\sdl-build-failure-test\zig-pkg\N-V-__8AAL9L9AJxY67Fhxp52_VHlLps195MF3irmi4z8Qge\include/build_config/SDL_build_config.h.cmake: config header value unused: HAVE_SENSORSAPI_H
The Windows config code in this package appears to provide them to b.addConfigHeader, and removing the three entries locally allows the build to get past config-header generation:
I'm almost certain these are due to the upgrade to LLVM 22 or translate-c/arocc related (a couple of issues regarding missing builtins exist and/or have been fixed in translate-c)
Thanks for the report! I’ll make sure this is resolved before Zig 0.17 is tagged. I believe the translate C issue has been resolved upstream but this version isn’t yet pulled in by master branch zig, but will double check.
I don't have a mac to test on, but I just kicked off a CI run to see if macOS has a similar issue WRT the build header defines.
I'm also building latest Zig locally right now, if building SDL for Windows still fails due to the vector conversions I'll check with latest translate C to verify that it's been resolved & make sure that fix gets in for the tag.
The vector conversion issue was solved by updating to the latest translate C by depending on the translate C package instead of the translate C step, this is how translate C will work in the future anyway. The package has some fixes that didn't make it into the in-repo version yet.
The fix is in #23, I'm waiting to merge it until Zig 0.17.0 is tagged since it breaks compat with Zig 0.16.0, but you're welcome to depend on that branch instead of master if you're targeting latest Zig. That's what I'll be doing.
Activity
MasonRemaley commentedon Jun 4, 2026
Thanks for the report! I’ll make sure this is resolved before Zig 0.17 is tagged. I believe the translate C issue has been resolved upstream but this version isn’t yet pulled in by master branch zig, but will double check.
kenjpirkle commentedon Jun 4, 2026
Much appreciated, thank you!
I had a quick look and it seems to be down to these changes: https://codeberg.org/ziglang/zig/commit/9989f72c61e4c4e98c69f6191a63c201336a6a19#diff-d4e3d13ed5f02fd67c14d0f0289ace71c5faec31 (ensureAllValuesUsed) - the previous version was checking unused autoconf and nasm values, but not cmake values, letting the build succeed.
(P.S. Loved the talks you gave!)
Removes deprecated Windows build config options
MasonRemaley commentedon Jun 5, 2026
No prob! I was about to get blocked by this too.
That makes sense, I also noticed this in 43f8a9c but failed to fix the Windows defines there because I didn't scroll past the translate C errors.
Thanks!! :)
MasonRemaley commentedon Jun 5, 2026
I don't have a mac to test on, but I just kicked off a CI run to see if macOS has a similar issue WRT the build header defines.
I'm also building latest Zig locally right now, if building SDL for Windows still fails due to the vector conversions I'll check with latest translate C to verify that it's been resolved & make sure that fix gets in for the tag.
[EDIT] macOS passed CI
Switches to external translate C package to get latest fixes
MasonRemaley commentedon Jun 5, 2026
The vector conversion issue was solved by updating to the latest translate C by depending on the translate C package instead of the translate C step, this is how translate C will work in the future anyway. The package has some fixes that didn't make it into the in-repo version yet.
The fix is in #23, I'm waiting to merge it until Zig 0.17.0 is tagged since it breaks compat with Zig 0.16.0, but you're welcome to depend on that branch instead of master if you're targeting latest Zig. That's what I'll be doing.
Switches to external translate C package to get latest fixes
Switches to external translate C package to get latest fixes
jayschwa commentedon Oct 4, 2026
I am closing this issue because Windows builds appear to be working with tagged Zig 0.17.0. If I am mistaken, feel free to reopen the issue.
MasonRemaley commentedon Oct 4, 2026
I'll get this branch merged after I get back from SYCL, or possibly sooner