Hmm, first, as far as I’m aware, @cImport
can only import API declarations but not compile the C implementation code (e.g. cImport
is typically used on C headers, not C source files)
If you just want to build and run that program with the Zig compiler, try:
zig cc -std=c89 donut.c -o donut
E.g. the -std=c89
causes the code to be compiled as C89.
When using the Zig build system to build C code, check the function addCSourceFiles
and the flags
field in the AddCSourceFileOptions
struct: Zig Documentation