Installing a library with C dependencies on Windows

I’ve tried your suggestions here’s what worked and what didn’t:

  • If I remove mingw from the path then cabal can no longer find pkg-config even though the right directory has been added to the extra-prog-path.
  • Building it with ghcup run --mingw-path -- cabal install hackage-cli does work, but produces an executable that only works when you run it under ghcup run --mingw-path -- ... too.

Checking the linking yields these (and a bunch more windows specific dlls with an absolute path):

        libbrotlicommon.dll => /mingw64/bin/libbrotlicommon.dll (0x7ffaf2c00000)
        libbrotlidec.dll => /mingw64/bin/libbrotlidec.dll (0x7ffaf2d80000)
        libbrotlienc.dll => /mingw64/bin/libbrotlienc.dll (0x7ffa6b330000)
        libcrypto-3-x64.dll => /mingw64/bin/libcrypto-3-x64.dll (0x7ffa6b3f0000)
        libssl-3-x64.dll => /mingw64/bin/libssl-3-x64.dll (0x7ffa6b240000)

I don’t know how to fix this.

1 Like