Skip to content

ghc requires main to be in Main

it looks like ghc requires that the main function
be defined in the module Main, rather than simply
be exported from Main as the report says.  

here is an example:

module Main(main) where
import B


module B where
main = print "hello"


ghc B.hs Main.hs
Module `Main' must include a definition for `main'

i tried this using ghc-5.02 on linux (mandrake 8.0 
distribution)
Trac metadata
Trac field Value
Version 5.02
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution ResolvedFixed
Component Compiler
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information