cabal link error undefined symbol on windows

39 views Asked by At
  • I worked on linux and macos without any cabal problems at all.
  • When I moved to windows I can't link even the simplest application:
> cabal --version
cabal-install version 3.10.2.0
compiled using version 3.10.2.1 of the Cabal library
> ghc --version
The Glorious Glasgow Haskell Compilation System, version 9.8.1

Here is my cabal file:

cabal-version: 3.0
name: dummy
version: 0.1.0.0

common warnings
    ghc-options: -Wall

executable dummy

    main-is: Main.hs
    other-modules: Token,
                   Location

    build-depends: base ^>=4.19.0.0,
                   aeson

    hs-source-dirs: app
    default-language: GHC2021

And here is the error I get:

[1 of 3] Compiling Location         ( ... omitted ... )
[2 of 3] Compiling Main             ( ... omitted ... )
[3 of 3] Compiling Token            ( ... omitted ... )
[4 of 4] Linking C:\\Users\\tuna_\\GitHub\\dummy\\dist-newstyle\\build\\x86_64-windows\\ghc-9.8.1\\dummy-0.1.0.0\\x\\dummy\\build\\dummy\\dummy.exe
ld.lld: error: undefined symbol: ghczuwrapperZC0ZChashablezm1zi4zi3zi0zm831f04650334ef00351e2c0c0ce1091477ecdcb2ZCDataziHashableziLowLevelZChashablezufnvzuhashzuoffset

I tried adding various flags for cabal build (though none were needed on macos and linux):

  • --enable-executable-static (didn't work)
  • --disable-executable-dynamic (didn't work)
  • --enable-static (didn't work)
  • --disable-shared (you guessed it, didn't work)

I'm pretty sure the actual source files don't matter, but let me know in the comments if they are needed.

0

There are 0 answers