Hi. I want to import a local C header file through @cImport, but I can't figure out how to do so.
I've included the file in build.zig and the header file in on the same directory where build.zig lives.
Error log:
src/main.zig:2:11: error: C import failed
const c = @cImport(@cInclude("ee.h"));
^~~~~~~~~~~~~~~~~~~~~~~~~~~
src/main.zig:2:11: note: libc headers not available; compilation does not link against libc
Here's what I've tried
const std = @import("std");
const c = @cImport(@cInclude("ee.h"));
pub fn main() !void {
c.hi();
}
Header (ee.h)
#include <stdio.h>
void hi()
{
printf("test");
}
...and build.zig
(too large, so posted here https://srcb.in/ozEtQSu5mE)
I've also tried to locate the header file in @cImport but nothing seems to work for me. Anyone knows what and where I'm missing something?
Thank you.