Build for Linux, macOS, and Windows
One toolchain, many platforms.
One Toolchain, Many Platforms
From a single machine you can produce binaries for every major OS. Zig treats cross-builds as first-class, not an afterthought.
Build for Linux
Target Linux by naming its triple. The musl ABI gives you a clean, portable Linux executable from any host.
zig build-exe main.zig -target x86_64-linux-muslAll lessons in this course
- Targets and the -target Triple
- Build for Linux, macOS, and Windows
- Cross-Compiling C with zig cc
- Static Binaries and musl