diff --git a/build.zig b/build.zig index 71741a0136..1473fcbf3c 100644 --- a/build.zig +++ b/build.zig @@ -568,14 +568,14 @@ fn addCmakeCfgOptionsToExe( // back to -lc++ and cross our fingers. addCxxKnownPath(b, cfg, exe, b.fmt("libstdc++.{s}", .{lib_suffix}), "", need_cpp_includes) catch |err| switch (err) { error.RequiredLibraryNotFound => { - exe.linkSystemLibrary("c++"); + exe.linkLibCpp(); }, else => |e| return e, }; exe.linkSystemLibrary("unwind"); }, - .ios, .macos, .watchos, .tvos => { - exe.linkSystemLibrary("c++"); + .ios, .macos, .watchos, .tvos, .windows => { + exe.linkLibCpp(); }, .freebsd => { if (static) {