From a06aaef26b377b7708460696bf8082afcc088301 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emilio=20L=C3=B3pez?= Date: Thu, 19 Oct 2023 21:05:22 -0300 Subject: [PATCH] Fix linking error addDLL: stdc++ or dependencies not loaded. (Win32 error 126) See also: * https://gitlab.haskell.org/ghc/ghc/-/issues/22738 * https://gitlab.haskell.org/ghc/ghc/-/wikis/migration/9.4?version_id=b60e52482a666d25638d59cd7e86851ddf971dc1#link-against-system-cxx-std-lib-instead-of-stdc --- package.yaml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/package.yaml b/package.yaml index e8cf3454e..79288a20c 100644 --- a/package.yaml +++ b/package.yaml @@ -90,7 +90,9 @@ executables: extra-libraries: c++ ld-options: -Wl,-keep_dwarf_unwind ghc-options: -fcompact-unwind - - condition: os(windows) + - condition: os(windows) && impl(ghc >= 9.4) + build-depends: system-cxx-std-lib + - condition: os(windows) && impl(ghc < 9.4) extra-libraries: stdc++ tests: @@ -114,7 +116,9 @@ tests: extra-libraries: c++ ld-options: -Wl,-keep_dwarf_unwind ghc-options: -fcompact-unwind - - condition: os(windows) + - condition: os(windows) && impl(ghc >= 9.4) + build-depends: system-cxx-std-lib + - condition: os(windows) && impl(ghc < 9.4) extra-libraries: stdc++ flags: