readme: fix build.zig example

As it turns out, it is important to link the C library also.
This commit is contained in:
2023-09-10 13:00:40 -07:00
parent 0b7b5e4f54
commit 136ef10775

View File

@@ -55,10 +55,10 @@ pub fn build(b: *std.Build) void {
.root_source_file = .{.path = "my_cool_project.zig"}, .root_source_file = .{.path = "my_cool_project.zig"},
}); });
my_program.addModule( const nats_dep = b.dependency("nats", .{});
"nats",
b.dependency("nats", .{}).module("nats"), my_program.addModule("nats", nats_dep.module("nats"));
); my_program.linkLibrary(nats_dep.artifact("nats-c"));
b.installArtifact(my_program); b.installArtifact(my_program);
} }