Zig translate-c fails

I tried for the first time to run translate-c but I got some errors.
I’m on Linux, with zig 0.17.0-dev.1158+1d1193aa7.

The C code is at timerfd_create(2) - Linux manual page.

The first error is:

error: translation failure
timerfd3_demo.c:27:10: error: 'err.h' not found
#include <err.h>

If I comment <inttypes.h> I got an error with:

/home/manlio/.local/share/sdk/zig/master/lib/include/inttypes.h:24:15: error: 'inttypes.h' not found
#include_next <inttypes.h>

Thanks.

You probably just need to add a -lc as a command line arg of zig translate-c

1 Like