
2 Jul
2002
2 Jul
'02
6:31 p.m.
[04:14pm 0.11 0.15 0.16 ~/CGI]$ ghc Counter.lhs compilation IS NOT required Counter.o: In function `__stginit_Main': Counter.o(.text+0x16): undefined reference to `__stginit_CGI' [...]
Your invocation of the ghc command is telling GHC to just compile Counter.lhs to Counter.o and then create an executable (link) with just Counter.o, not CGI.o. The linker then complains about undefined references to the CGI module. Solution 1: GHC works just like an ordinary UNIX-style C compiler. Specify CGI.o on the command line. Solution 2: use ghc --make Counter.lhs GHC will automatically look for all required modules and compile them if necessary (for GHC versions >= 5). Cheers, Wolfgang