'gcc.exe' 在 'Assembler' 阶段失败,而 运行 Haskell 代码

'gcc.exe' failed in phase 'Assembler' while running Haskell code

我有以下 Haskell 代码,它只显示两个数字的和、差、乘积和商,以及从 1 到 10 的数字和字母的 运行ge。

main = do

    let a = 5
    let b = 10
    
    putStrLn "The addition of the two numbers is: "
    print(a + b);
    
    putStrLn "The subtraction of the two numbers is: "
    print(a - b);
    
    putStrLn "The multiplication of the two numbers is: "
    print(a * b);
    
    putStrLn "The division of the two numbers is: "
    print(a * b);
    
    print [1..10]
    print ['a'..'z']

我在在线编译器上 运行 它似乎可以工作,但是当我将它粘贴到记事本并通过终端 运行 它时,它显示错误:

Fatal error: can't create basicOperators.o: No such file or directory
`gcc.exe' failed in phase `Assembler'. (Exit code: 1)

这很有趣,因为我的计算机上安装了 GHC,并且 Haskell 编译器几天前工作得很好,但现在它停止工作了。我仍然是 Haskell 的初学者,我需要了解如何避免出现此错误。如果有人有想法,我将不胜感激。

作为@n。 'pronouns' 我评论说,GHC 写入此文件夹似乎有问题。尝试使用不同的文件夹,例如创建 C:\Temp、复制代码并从那里编译。