<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:times new roman,new york,times,serif;font-size:12pt"><div>Hello,<br><br>I have the following directories set :<br>Project/<br>Project/Language<br>Project/Language/Copilot/<br>in Project there is the copilot.cabal file.<br>in Project/Language/Copilot there are a bunch of .hs files, including Main.hs<br>All the modules in these files are named Language.Copilot.NameOfTheFile for cabal to work.<br><br>My issue happened when I chose to add a Main.hs, containing Language.Copilot.Main and to try to compile it with ghc --make.<br>I got the error message <span style="font-style: italic;">"output was redirected with -o, but no output will be generated because there is no Main module."</span><br>So I replaced Language.Copilot.Main by Main. ghc was happy, but cabal sent me the following error message :<br><span style="font-style: italic;">&nbsp;"File name does
 not match module name:</span><br style="font-style: italic;"><span style="font-style: italic;">&nbsp;&nbsp;&nbsp; Saw: `Main'</span><br style="font-style: italic;"><span style="font-style: italic;">&nbsp;&nbsp;&nbsp; Expected: `Language.Copilot.Main'</span>"<br>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 :<br><span style="font-style: italic;">"/usr/lib/ghc-6.12.1/libHSrtsmain.a(Main.o): In function `main':</span><br style="font-style: italic;"><span style="font-style: italic;">(.text+0x10): undefined reference to `ZCMain_main_closure'</span><br style="font-style: italic;"><span style="font-style: italic;">/usr/lib/ghc-6.12.1/libHSrtsmain.a(Main.o): In function `main':</span><br style="font-style: italic;"><span style="font-style: italic;">(.text+0x18): undefined reference to `__stginit_ZCMain'</span><br style="font-style: italic;"><span
 style="font-style: italic;">collect2: ld returned 1 exit status</span>"<br><br>Does anyone know what this last message mean, and how to make both cabal and ghc happy with my module name ?<br><br>Thank you in advance,<br><br>Robin<br><br style="font-style: italic;"><br><br></div>
</div><br>




      </body></html>