Cross-Compiling C with zig cc
Use Zig as a portable C compiler.
Zig Is Also a C Compiler
Beyond Zig code, the toolchain includes a full C compiler. The zig cc command behaves like a drop-in for gcc or clang.
zig cc main.c -o appCross-Compile C Too
The same -target flag works for C. You can build a C program for another platform with zig cc from any host.
zig cc -target aarch64-linux-musl main.c -o appAll 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