# Can you build a binary for Windows 7?

**URL:** <https://ziggit.dev/t/can-you-build-a-binary-for-windows-7/18184>\
**Category:** Help\
**Tags:** build-system, standard-library, cross-compile\
**Created:** [November 2, 2026, 5:34am UTC](https://ziggit.dev/t/can-you-build-a-binary-for-windows-7/18184 "2026-11-02T05:34:54Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Robert.Buch](https://ziggit.dev/letter_avatar_proxy/v4/letter/r/45deac/32.png) [@Robert.Buch](https://ziggit.dev/u/Robert.Buch)\
**Post date:** [November 2, 2026, 5:34am UTC](https://ziggit.dev/t/can-you-build-a-binary-for-windows-7/18184/1 "2026-11-02T05:34:54Z")

</div>

I want to make a tool for a friend who is still on Windows 7. (Reads some folders/files, analyses them, prints results, done.) Yes, we all know that anything older than Windows 11 is no longer supported by Microsoft. No, he will not be upgrading his computer anytime soon, especially with the recent… events. Whatever I make, it has to run on 32-bit Win 7, otherwise it’s useless.

So far, using Zig, the default project provided by `zig init` doesn’t even run on his computer. Reason being that the standard library uses syscalls such as `NtAlertThreadByThreadId`, which was added in Win 8. In a perfect world, the standard library would first check the build’s OS version range via `builtin.os.version_range.windows.isAtLeast(.win8)`. However, I fully understand that this would be a huge amount of work to do for every single Windows syscall everywhere, especially since you then also have to come up with workarounds for old OS versions.

So, what can I do?

It looks like to me that I am simply forced to use a different language. Well, in that case, can anyone suggest something that would work? Some old version of a C compiler+library, or maybe something else entirely. I’m using Windows 10 myself, and I have a feeling that simply getting to the point that I have anything that runs at all is gonna be really annoying…

---

<div class="post-metadata">

**Author:** ![vodomerkin](https://ziggit.dev/user_avatar/ziggit.dev/vodomerkin/32/8806_2.png) [@vodomerkin](https://ziggit.dev/u/vodomerkin)\
**Post date:** [November 2, 2026, 6:38am UTC](https://ziggit.dev/t/can-you-build-a-binary-for-windows-7/18184/2 "2026-11-02T06:38:47Z")

</div>

You can patch std in your Zig installation to use Win7-compatible calls. But I’m suspecting that this could be quite a task.

Alternatively you can skip Io-interface and directly call whatever you need, but now that I think about it, you will need to avoid `std.debug` and `std.log` to not involve Io-interface.

To be honest, having Win7-compatible (or WinXP or Win95!) `Io` would be nice to have, but I’m suspecting that if this will happen it should not be expected to be maintained by Zig team.

---

<div class="post-metadata">

**Author:** ![ScottRedig](https://ziggit.dev/user_avatar/ziggit.dev/scottredig/32/5880_2.png) [@ScottRedig](https://ziggit.dev/u/ScottRedig)\
**Post date:** [November 2, 2026, 6:48am UTC](https://ziggit.dev/t/can-you-build-a-binary-for-windows-7/18184/3 "2026-11-02T06:48:43Z")

</div>

[Zig 0.17.0 lists Windows 10 as the minimum required version of Windows](https://ziglang.org/download/0.17.0/release-notes.html#OS-Version-Requirements). This has been the minimum required version for at least a couple years. [Here’s an issue from 2020 where Windows 7 stopped being supported](https://github.com/ziglang/zig/issues/7242).

I’m sorry for your friend, but Windows 10 has been out for over a decade. Supporting such an old system (pre-10) simply isn’t a priority for the Zig maintainers. Too much effort for too little benefit. Heck, even modern Windows isn’t in the top tier of support. Your friend may be able to run your programs if they install Linux on their machine instead, but with such an old machine there may be other difficulties.

---

<div class="post-metadata">

**Author:** ![IceGuye](https://ziggit.dev/letter_avatar_proxy/v4/letter/i/b782af/32.png) [@IceGuye](https://ziggit.dev/u/IceGuye)\
**Post date:** [November 2, 2026, 7:55am UTC](https://ziggit.dev/t/can-you-build-a-binary-for-windows-7/18184/4 "2026-11-02T07:55:09Z")

</div>

The best bet is target the x86-windows-gnu, and use -ofmt=c to emit a piece of C codes…

Then you can use Wine (assuming that you can use Linux or WhateverBSD or at least on a virtual machine or maybe Windows Linux subsystem) to install a MinGW then compile your emitted C codes to an exe… If you can run your codes on Wine, it should work on Windows 7… Wine can even emulate all the way back to Windows XP or something…

---

<div class="post-metadata">

**Author:** ![marler8997](https://ziggit.dev/user_avatar/ziggit.dev/marler8997/32/77_2.png) [@marler8997](https://ziggit.dev/u/marler8997)\
**Post date:** [November 2, 2026, 5:42pm UTC](https://ziggit.dev/t/can-you-build-a-binary-for-windows-7/18184/5 "2026-11-02T17:42:11Z")

</div>

Actually it’s real easy to patch std: [Welcome to Johnny's World](https://marler8997.github.io/blog/zig-patch/)

---

<div class="post-metadata">

**Author:** ![IntegratedQuantum](https://ziggit.dev/user_avatar/ziggit.dev/integratedquantum/32/782_2.png) [@IntegratedQuantum](https://ziggit.dev/u/IntegratedQuantum)\
**Post date:** [November 2, 2026, 6:32pm UTC](https://ziggit.dev/t/can-you-build-a-binary-for-windows-7/18184/6 "2026-11-02T18:32:58Z")

</div>

There is also [VxKex](https://github.com/i486/VxKex) a tool that emulates missing API functions on Windows 7.  
I haven’t tried it myself, but someone used this tool to run Cubyz on Windows 7, so I’d assume it would also work for simpler Zig programs.
