#How to translate-c a system header?

1 messages · Page 1 of 1 (latest)

soft ether
#

Let's say I want to translate the curl/curl.h. What are the correct arguments for the CLI command?

sharp hound
#

zig translate-c -lc <source or header file(s)> > file.zig
If necessary add -I<IncludePath> and another libs -lpthreads.

soft ether
#

Does it mean that I must know the exact header location on every system? When I use @cImport("curl/curl.h") it just works with -lcurl but I need to edit the translation. Can I somehow use the same knowledge the @cImport function has about the system?

sharp hound
#

If it's installed on the system, -lc (linklibC()) already detects it on the system.
See zig libc config.

sharp hound
gentle zodiac
gentle zodiac