[Haskell-cafe] cabal and ghc disagree on the name of the module Main

robin morisset amulettevid at yahoo.fr
Tue Jul 6 19:18:36 EDT 2010


I have the following directories set :
in Project there is the copilot.cabal file.
in Project/Language/Copilot there are a bunch of .hs files, including Main.hs
All the modules in these files are named Language.Copilot.NameOfTheFile for 
cabal to work.

My issue happened when I chose to add a Main.hs, containing 
Language.Copilot.Main and to try to compile it with ghc --make.
I got the error message "output was redirected with -o, but no output will be 
generated because there is no Main module."
So I replaced Language.Copilot.Main by Main. ghc was happy, but cabal sent me 
the following error message :
 "File name does not match module name:
    Saw: `Main'
    Expected: `Language.Copilot.Main'"
So I finally kept the Language.Copilot.Main module name, and tried to use the 
-main-is ghc option. The result was an unreadable linker error message :
"/usr/lib/ghc-6.12.1/libHSrtsmain.a(Main.o): In function `main':
(.text+0x10): undefined reference to `ZCMain_main_closure'
/usr/lib/ghc-6.12.1/libHSrtsmain.a(Main.o): In function `main':
(.text+0x18): undefined reference to `__stginit_ZCMain'
collect2: ld returned 1 exit status"

Does anyone know what this last message mean, and how to make both cabal and ghc 
happy with my module name ?

Thank you in advance,


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/haskell-cafe/attachments/20100706/409e406c/attachment.html

More information about the Haskell-Cafe mailing list