1

I downloaded and installed stack using the installer on Windows.

I then try to run:

    $ stack new new-project rio
    $ cd new-project
    $ stack run

This leads to this error:

WARNING: Ignoring mintty's bounds on Win32 (>=2.13.1); using Win32-2.6.2.1.
Reason: trusting snapshot over cabal file dependency information.
Linking C:\\sr\\setup-exe-cache\\x86_64-windows\\tmp-Cabal-simple_Z6RU0evB_3.2.1.0_ghc-8.10.7.exe ...
C://Users//Patrick//AppData//Local//Programs//stack//x86_64-windows//ghc-8.10.7//mingw//bin/ld.exe: C:\\sr\setup-exe-src\setup-Z6RU0evB.o:fake:(.text+0x232): undefined reference to `Cabalzm3zi0zi1zi0_DistributionziSimple_defaultMain_closure'
C://Users//Patrick//AppData//Local//Programs//stack//x86_64-windows//ghc-8.10.7//mingw//bin/ld.exe: C:\\sr\setup-exe-src\setup-Z6RU0evB.o:fake:(.data+0x178): undefined reference to `Cabalzm3zi0zi1zi0_DistributionziSimple_defaultMain_closure'
collect2.exe: error: ld returned 1 exit status
`gcc.exe' failed in phase `Linker'. (Exit code: 1)

--  While building simple Setup.hs (scroll up to its section to see the error) using:
      C:\Users\Patrick\AppData\Local\Programs\stack\x86_64-windows\ghc-8.10.7\bin\ghc-8.10.7.exe -rtsopts -threaded -clear-package-db -global-package-db -hide-all-packages -package base -main-is StackSetupShim.mainOverride -package Cabal-3.2.1.0 C:\sr\setup-exe-src\setup-Z6RU0evB.hs C:\sr\setup-exe-src\setup-shim-Z6RU0evB.hs -o C:\sr\setup-exe-cache\x86_64-windows\tmp-Cabal-simple_Z6RU0evB_3.2.1.0_ghc-8.10.7.exe

How can I resolve it? I am not even sure how to better understand the actual problem.

I am working with git bash.


I resolved the WARNING by editing stack.yaml. I have also tried installing pkg-config using pacman on mingw as in this answer but the package was not found.

Patrick
  • 879
  • 2
  • 11
  • 29
  • I this the first time you've installed haskell on this computer? I was thinking if it could some broken artefact from an older installation. – Hjulle Dec 11 '21 at 11:58
  • @Hjulle, yes, I think it's very likely the first time on this computer. What's the general direction I should be looking to resolve this? I am not quite sure what is actually happening. – Patrick Jan 06 '22 at 21:31
  • I don't really know either. It might be worth reporting this as an issue to the [`stack` repo](https://github.com/commercialhaskell/stack/issues). You can test if it helps to upgrade to a newer version of stackage and/or using a simpler template (e.g. the default template). – Hjulle Jan 07 '22 at 06:34

0 Answers0