I'm trying to run a very simple Haskell program in Windows.
I have Visual Studio 2019 and Windows 11. And have installed the stack
for Windows. [stack-2.9.3-windows-x86_64-installer.exe]
stack new hello-world
cd hello-world
stack build
But it throws this error:
|
819 | _CRTIMP size_t __cdecl _fread_nolock_s(void *_DstBuf,size_t _DstSize,size_t _ElementSize,size_t _Count,FILE *_File);
| ^
`gcc.exe' failed in phase `C Compiler'. (Exit code: 1)
Error: [S-6374]
While building simple Setup.hs (scroll up to its section to see the error) using:
C:\Users\Quarks\AppData\Local\Programs\stack\x86_64-windows\ghc-9.2.7\bin\ghc-9.2.7.exe -rtsopts -threaded -clear-package-db -global-package-db -hide-all-packages -package base -main-is StackSetupShim.mainOverride -package Cabal-3.6.3.0 C:\sr\setup-exe-src\setup-sDt42OhJ.hs C:\sr\setup-exe-src\setup-shim-sDt42OhJ.hs -o C:\sr\setup-exe-cache\x86_64-windows\tmp-Cabal-simple_sDt42OhJ_3.6.3.0_ghc-9.2.7.exe
Process exited with code: ExitFailure 1
Quarks hello-world |
819 | _CRTIMP size_t __cdecl _fread_nolock_s(void *_DstBuf,size_t _DstSize,size_t _ElementSize,size_t _Count,FILE *_File);
| ^
`gcc.exe' failed in phase `C Compiler'. (Exit code: 1)
Error: [S-6374]
While building simple Setup.hs (scroll up to its section to see the error) using:
C:\Users\Quarks\AppData\Local\Programs\stack\x86_64-windows\ghc-9.2.7\bin\ghc-9.2.7.exe -rtsopts -threaded -clear-package-db -global-package-db -hide-all-packages -package base -main-is StackSetupShim.mainOverride -package Cabal-3.6.3.0 C:\sr\setup-exe-src\setup-sDt42OhJ.hs C:\sr\setup-exe-src\setup-shim-sDt42OhJ.hs -o C:\sr\setup-exe-cache\x86_64-windows\tmp-Cabal-simple_sDt42OhJ_3.6.3.0_ghc-9.2.7.exe
Process exited with code: ExitFailure 1