I'm importing Linenoise (https://github.com/antirez/linenoise, located locally at deps/linenoise)
Here are the relevant portions of my code:
// build.zig
exe.addIncludePath(b.path("deps"));
// src/main.zig
const Linenoise = @cImport({
@cInclude("linenoise/linenoise.c");
});
pub fn main() !void {
_ = Linenoise.linenoise("prompt>");
}
When I execute zig build I get the following error:
$ zig build
/myprojectpathhere/.zig-cache/o/41e200993f7f9ddf9a76c95c36ecdb26/cimport.zig:1741:5: error: expected type '[*c]u8', found '*const [4:0]u8'
"dumb",
^~~~~~
The relevant piece of code in the generated cimport.zig:
pub var unsupported_term: [4][*c]u8 = [4][*c]u8{
"dumb",
"cons25",
"emacs",
null,
};
What am I doing wrong, or is this a bug in Zig?