Haskell Parsec编译错误

cho*_*ida 6 windows haskell parsec

我已经通过预构建的安装程序v6.8.2安装了Haskell.

尝试使用GHC编译此示例文件时

module Main where
import Text.ParserCombinators.Parsec
import System.Environment

main :: IO ()
main = do args <- getArgs
          putStrLn ("Hello")
Run Code Online (Sandbox Code Playgroud)

我收到以下错误:

D:\src\Haskell>ghc -o read read.hs
ghc -o read read.hs
read.o(.text+0x1b5):fake: undefined reference to   `__stginit_parseczm2zi1zi0zi0_TextziParserCombinatorsziParsec_'
collect2: ld returned 1 exit status
Run Code Online (Sandbox Code Playgroud)

我已经通过cabal安装了Parsec.

有没有人知道什么是错的?

Cat*_*lus 9

试试ghc --make -o read read.hs.GHC将负责链接器依赖性.