GHC unable to find mingwinclude directory on Windows - Stack Overflow

时间: 2025-01-06 admin 业界

Today I used ghcup to automatically installed all haskell tool chains. When I entered ghc -Wall C:\2.hs -fforce-recomp,the response is:

[1 of 2] Compiling Main             ( C:\\2.hs, C:\\2.o ) clang: error: no such file or directory: 'Files\ghcup\ghc\9.4.8\lib\../mingw/include'

<no location info>: error:
    `clang.exe' failed in phase `Assembler'. (Exit code: 1)

I mean, this directory exists: C:\Program Files\ghcup\ghc\9.4.8\mingw and under this directory C:\Program Files\ghcup\ghc\9.4.8\lib, it does not have a path named mingw. How can I fix it? (On windows11)