Search code examples
windowshaskellparsec

Haskell Parsec compile error


I've installed Haskell via the pre built installer v6.8.2.

When trying to compile this sample file with GHC

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

main :: IO ()
main = do args <- getArgs
          putStrLn ("Hello")

I get the following error:

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

I have installed Parsec via cabal.

Does anyone have any idea's as to what is wrong?


Solution

  • Try ghc --make -o read read.hs. GHC will take care of linker dependencies.