From 4a7635fa7b18a31976d49063a9f26ea03ccac6e4 Mon Sep 17 00:00:00 2001 From: torque Date: Wed, 16 Aug 2023 23:30:04 -0700 Subject: [PATCH] nats-c.build.zig: fix cross-compiling from Linux There is a case-sensitivity issue here. The Windows documentation calls the library Ws2_32, but the mingw cross-compilation on Linux fails unless it is called `ws3_32`. For some reason, both work on macOS. I have not tried on Windows, but I assume this will probably work there due to everything being extremely insensitive (case-wise) on Windows. --- nats-c.build.zig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nats-c.build.zig b/nats-c.build.zig index 06d191c..ffeda56 100644 --- a/nats-c.build.zig +++ b/nats-c.build.zig @@ -36,7 +36,7 @@ pub fn nats_c_lib( lib.addCSourceFiles(&.{"src/win-crosshack.c"}, &.{"-fno-sanitize=undefined"}); } lib.defineCMacro("_WIN32", null); - lib.linkSystemLibrary("Ws2_32"); + lib.linkSystemLibrary("ws2_32"); }, .macos => { lib.addCSourceFiles(&unix_sources, &.{"-fno-sanitize=undefined"});