#5574: undefined reference to `ZCMain_main_closure' and undefined reference to
`ZCMain_main_closure'
--------------------------+-------------------------------------------------
Reporter: francisco | Owner:
Type: bug | Status: new
Priority: normal | Component: Compiler
Version: 7.0.3 | Keywords:
Testcase: | Blockedby:
Os: Linux | Blocking:
Architecture: x86 | Failure: None/Unknown
--------------------------+-------------------------------------------------
Environment of work
____________________________________________________________________
Ubuntu 11.10
$ uname -a
Linux fmgo-HP 3.0.0-12-generic #20-Ubuntu SMP Fri Oct 7 14:50:42 UTC 2011
i686 i686 i386 GNU/Linux
$ ghci
GHCi, version 7.0.3
$gcc -v
....
gcc versión 4.6.1 (Ubuntu/Linaro 4.6.1-9ubuntu3)
____________________________________________________________________
The problem
____________________________________________________________________
I composed the file "TorresHanoiMenu.hs" that import and uses
"TorresHanoi.hs" (attached in a .zip file)
GHCi produces la following dialog
$ ghci TorresHanoiMenu.hs
[1 of 2] Compiling TorresHanoi ( TorresHanoi.hs, interpreted )
[2 of 2] Compiling TorresHanoiMenu ( TorresHanoiMenu.hs, interpreted )
Ok, modules loaded: TorresHanoiMenu, TorresHanoi.
*TorresHanoiMenu>
and the program works "fine" (execpt for the definition of "mover", see
ticket #5572).
Well, now I wish to produce an executable program from TorresHanoiMenu.hs,
therefore I make
$ ghc --make TorresHanoiMenu.hs
At this moment the files .o and .hi are generated but not so the
executable. I deleted the files .o and .hi. Next I make
$ ghc -c -O TorresHanoi.hs TorresHanoiMenu.hs
and the files .o and .hi are newly generated. Then I make
$ ghc -o menu -O TorresHanoi.o TorresHanoiMenu.o
and the generated message of error is:
/usr/lib/ghc-7.0.3/libHSrtsmain.a(Main.o): In function `main':
(.text.startup+0x10): undefined reference to `ZCMain_main_closure'
/usr/lib/ghc-7.0.3/libHSrtsmain.a(Main.o): In function `main':
(.text.startup+0x18): undefined reference to `__stginit_ZCMain'
collect2: ld devolvió el estado de salida 1
Of course there is no executable "menu" file.
The problem or bug exists in: GHCi ver. 6.10.4 and GHCi ver. 6.12.3
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/5574>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs