在 Windows 上使用 Haskell 构建一个简单的 hello-world 应用程序

问题描述 投票:0回答:0

我正在尝试在 Windows 中运行一个非常简单的 Haskell 程序。

我有 Visual Studio 2019 和 Windows 11。并安装了适用于 Windows 的

stack
。 [stack-2.9.3-windows-x86_64-installer.exe]

stack new hello-world
cd hello-world
stack build

但是它抛出这个错误:

    |
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
haskell haskell-stack
© www.soinside.com 2019 - 2024. All rights reserved.