From 136ef10775a087317c20d6c78fbb6f5c072d1308 Mon Sep 17 00:00:00 2001 From: torque Date: Sun, 10 Sep 2023 13:00:40 -0700 Subject: [PATCH] readme: fix build.zig example As it turns out, it is important to link the C library also. --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 131f167..bc0ff99 100644 --- a/README.md +++ b/README.md @@ -55,10 +55,10 @@ pub fn build(b: *std.Build) void { .root_source_file = .{.path = "my_cool_project.zig"}, }); - my_program.addModule( - "nats", - b.dependency("nats", .{}).module("nats"), - ); + const nats_dep = b.dependency("nats", .{}); + + my_program.addModule("nats", nats_dep.module("nats")); + my_program.linkLibrary(nats_dep.artifact("nats-c")); b.installArtifact(my_program); }