trying to compile a cgi library from hugs
Wolfgang Thaller
wolfgang.thaller@gmx.net
Wed, 3 Jul 2002 00:31:25 +0200
> [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