I have a build script for a library I am working on. It creates the library with
const lib = b.addSharedLibrary("my_library", "src/lib.zig", .unversioned); lib.addPackage(.{ .name = "interface", .path = .{ .path = "libs/interface.zig/interface.zig" }, });
However when I try to use @import("interface") in src/lib.zig, the compiler says:
@import("interface")
error: unable to find 'interface'
Do you know what the reason could be? When I use the exact same addPackage call to an exe, it works just fine.
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
Take off every Zig!
I have a build script for a library I am working on. It creates the library with
However when I try to use
@import("interface")
in src/lib.zig, the compiler says:Do you know what the reason could be? When I use the exact same addPackage call to an exe, it works just fine.