i have a really simple pair of files, main.zig and something.h w/ a single struct definition in the .h file and then trying to use that struct in .zig but the compiler keeps telling me "file not found" even though when i look in zig-out i can clearly see that it's compiling the .h file.
both files are in src/ and i don't know if that's a problem.
don't know if it's relevant, but i'm using windows -- for all i know it doesn't work on windows yet, but i didn't see anything in the docs saying so it's probably something i'm doing wrong
main.zig
const std = @import("std");
const something = @cImport({ @cInclude("src/something.h"); });
pub fn main() !void {
var s: something.something = .{ .a = 1, .b = 2, .c = 3, };
_ = s.a + s.b;
}
something.h
struct something {
int a;
int b;
int c;
};
i have also added the following to build.zig
exe.addIncludePath("src");
exe.addCSourceFile("src/something.h", &[_][]const u8 {});
exe.linkLibC();
so far i can only get it to give me 2 errors
error: C import failedwith no other details- if i remove the
src/from the@cIncludestatement, it tells me file not found