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

robin morisset amulettevid at yahoo.fr
Tue Jul 6 22:03:48 EDT 2010


Hello,

> (Ivan Lazar Miljenovi)

> Why not just have a Main.hs file?

> As for that error message, do you have a main function?  Are you sure
> you were using --make?

thank you for taking the time for reply. A friend finally found the issue. The 
main function in the Main module was ok, the problem was in the cabal file. I 
did not know it could be specified whether you want to get a library or an 
executable (before there was only the library specified). Now both are 
mentionned in the cabal file (the executable depends on the library) and 
everything is fine.

Here is an extract of the cabal file in case someone else has the same problem :
 library
    ghc-options:     -Wall
    build-depends:     base > 4 && < 5
                    ...

    extensions:
    exposed-modules: Language.Copilot
                                Language.Copilot.Core
                                ... -- Not Main here !
executable copilot
    executable: copilot
    hs-source-dirs:  .
                     Language/Copilot
    other-modules:   Core
                     ... -- Nor here !
    main-is:         Main.hs

Thank you again, and sorry for bothering you with that issue which was finally 
only a cabal configuration mistake and not a real haskell issue.

Robin



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


More information about the Haskell-Cafe mailing list