Can You Export A C Header from Zig?
tl;dr:
You used to but not anymore.
You used to be able to export a C header when building a library with Zig, but as of Zig v0.12 you can’t anymore. The breakage was intentional, according to Matthew Lugg, a Zig core team member & compiler developer, who wrote in July, “Yes, the panic was added intentionally. Not only was emit-h broken anyway, but the old implementation strategy is fundamentally flawed. This will be resolved at some point, it’s just not that high on the priority list right now.”
This breakage impacts both the command line flag and build.zig, which means that if you want to use Zig for c library development, you’re going to have to write your own header file, which is a minor annoyance at least.