You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$ uname -a
Darwin computer.lan 23.4.0 Darwin Kernel Version 23.4.0: Fri Mar 15 00:12:37 PDT 2024; root:xnu-10063.101.17~1/RELEASE_ARM64_T6031 arm64 arm Darwin
Create a new zig project and link against openssl.
$ zig init
Link against openssl in build.zig
diff --git a/build.zig b/build.zig
index 1aca853..8ea2200 100644
--- a/build.zig
+++ b/build.zig
@@ -36,6 +36,8 @@ pub fn build(b: *std.Build) void {
.optimize = optimize,
});
+ exe.linkSystemLibrary("openssl");
+
// This declares intent for the executable to be installed into the
// standard location when the user invokes the "install" step (the default
// step when running `zig build`).
Build
[nix-shell:~/uhdz]$ zig build
install
└─ install project
└─ zig build-exe project Debug native failure
error: warning: Unrecognized C flag from NIX_CFLAGS_COMPILE: -F/nix/store/sxzlz1jn2hxpvh4w2vylcqz4w1l1xf1f-apple-framework-CoreFoundation-11.0.0/Library/Frameworks
warning: Unrecognized C flag from NIX_LDFLAGS: /nix/store/sxzlz1jn2hxpvh4w2vylcqz4w1l1xf1f-apple-framework-CoreFoundation-11.0.0/Library/Frameworks/CoreFoundation.framework/CoreFoundation.tb
d
Run
$ zig run ./src/main.zig
All your codebase are belong to us.
Run `zig build test` to run the tests.
Expected Output
Successful build.
$ zig build
[nix-shell:~/uhdz]$ echo$?
0
The text was updated successfully, but these errors were encountered:
Zig Version
0.13.0-dev.46+3648d7df1
Steps to Reproduce and Observed Output
System
$ uname -a Darwin computer.lan 23.4.0 Darwin Kernel Version 23.4.0: Fri Mar 15 00:12:37 PDT 2024; root:xnu-10063.101.17~1/RELEASE_ARM64_T6031 arm64 arm Darwin
Zig Version
Nix Tomfoolery
Pull in some nix provided 'system' dependency
Zig Tomfoolery
Create a new zig project and link against openssl.
Link against
openssl
inbuild.zig
Build
[nix-shell:~/uhdz]$ zig build install └─ install project └─ zig build-exe project Debug native failure error: warning: Unrecognized C flag from NIX_CFLAGS_COMPILE: -F/nix/store/sxzlz1jn2hxpvh4w2vylcqz4w1l1xf1f-apple-framework-CoreFoundation-11.0.0/Library/Frameworks warning: Unrecognized C flag from NIX_LDFLAGS: /nix/store/sxzlz1jn2hxpvh4w2vylcqz4w1l1xf1f-apple-framework-CoreFoundation-11.0.0/Library/Frameworks/CoreFoundation.framework/CoreFoundation.tb d
Run
$ zig run ./src/main.zig All your codebase are belong to us. Run `zig build test` to run the tests.
Expected Output
Successful build.
The text was updated successfully, but these errors were encountered: