[Hackage] #179: support GHC's main-is extension

Hackage cvs-ghc at haskell.org
Sun Mar 6 23:41:56 CET 2011


#179: support GHC's main-is extension
----------------------------+-----------------------------------------------
  Reporter:  duncan         |        Owner:         
      Type:  enhancement    |       Status:  new    
  Priority:  low            |    Milestone:  _|_    
 Component:  Cabal library  |      Version:  1.2.2.0
  Severity:  normal         |     Keywords:         
Difficulty:  normal         |   Ghcversion:  6.4.2  
  Platform:  Linux          |  
----------------------------+-----------------------------------------------

Comment(by mcandre):

 Can someone give a correct use of the -main-is flag?

 {{{
 $ cat scriptedmain.hs
 #!/usr/bin/env runhaskell
 module ScriptedMain where

 meaningOfLife :: Int
 meaningOfLife = 42

 main :: IO ()
 main = putStrLn $ "Main: The meaning of life is " ++ show meaningOfLife
 $ ghc -o scriptedmain -main-is ScriptedMain.main scriptedmain.hs
 compilation IS NOT required
 Undefined symbols:
   "_ZCMain_main_closure", referenced from:
       _ZCMain_main_closure$non_lazy_ptr in libHSrtsmain.a(Main.o)
      (maybe you meant: _ZCMain_main_closure$non_lazy_ptr)
   "___stginit_ZCMain", referenced from:
       ___stginit_ZCMain$non_lazy_ptr in libHSrtsmain.a(Main.o)
      (maybe you meant: ___stginit_ZCMain$non_lazy_ptr)
 ld: symbol(s) not found
 collect2: ld returned 1 exit status
 }}}

-- 
Ticket URL: <http://hackage.haskell.org/trac/hackage/ticket/179#comment:7>
Hackage <http://haskell.org/cabal/>
Hackage: Cabal and related projects



More information about the cabal-devel mailing list