[Haskell-cafe] Template Haskell compilation error on Windows (was Re: speed: ghc vs gcc)

Peter Verswyvelen bugfact at gmail.com
Sat Feb 21 19:12:13 EST 2009


I tried to compile the template Haskell loop unrolling trick from Claus
Reinke on my machine which is running Windows and GHC 6.10.1, and I got
linker errors.
(note that compiling *without* -fvia-C works fine)

Compiling under Cygwin did not solve it. Any ideas how I could get this
working? I have no experience with TH yet so I might be missing something
essential...

Thanks,
Peter

c:\temp>ghc -O2 -fvia-C -optc-O3 -fforce-recomp Apply.hs
Apply.o:ghc6140_0.hc:(.text+0x7d): undefined reference to
`templatezmhaskell_LanguageziHaskellziTHziSyntax_VarP_con_info'
Apply.o:ghc6140_0.hc:(.text+0x10d): undefined reference to
`templatezmhaskell_LanguageziHaskellziTHziSyntax_VarE_con_info'
Apply.o:ghc6140_0.hc:(.text+0x19d): undefined reference to
`templatezmhaskell_LanguageziHaskellziTHziSyntax_VarP_con_info'
Apply.o:ghc6140_0.hc:(.text+0x571): undefined reference to
`templatezmhaskell_LanguageziHaskellziTHziSyntax_VarP_con_info'
Apply.o:ghc6140_0.hc:(.text+0x609): undefined reference to
`templatezmhaskell_LanguageziHaskellziTHziSyntax_VarE_con_info'
Apply.o:ghc6140_0.hc:(.text+0x6c9): undefined reference to
`templatezmhaskell_LanguageziHaskellziTHziSyntax_VarE_con_info'
Apply.o:ghc6140_0.hc:(.text+0x789): undefined reference to
`templatezmhaskell_LanguageziHaskellziTHziSyntax_VarE_con_info'
Apply.o:ghc6140_0.hc:(.text+0x82c): undefined reference to
`templatezmhaskell_LanguageziHaskellziTHziLib_a23_closure'
Apply.o:ghc6140_0.hc:(.text+0x868): undefined reference to
`templatezmhaskell_LanguageziHaskellziTHziLib_a23_closure'
Apply.o:ghc6140_0.hc:(.text+0x891): undefined reference to
`templatezmhaskell_LanguageziHaskellziTHziSyntax_VarP_con_info'
Apply.o:ghc6140_0.hc:(.text+0xd81): undefined reference to
`templatezmhaskell_LanguageziHaskellziTHziSyntax_VarP_con_info'
Apply.o:ghc6140_0.hc:(.text+0xe19): undefined reference to
`templatezmhaskell_LanguageziHaskellziTHziSyntax_VarE_con_info'
Apply.o:ghc6140_0.hc:(.text+0xed9): undefined reference to
`templatezmhaskell_LanguageziHaskellziTHziSyntax_VarE_con_info'
Apply.o:ghc6140_0.hc:(.text+0xf99): undefined reference to
`templatezmhaskell_LanguageziHaskellziTHziSyntax_VarE_con_info'
Apply.o:ghc6140_0.hc:(.text+0x103c): undefined reference to
`templatezmhaskell_LanguageziHaskellziTHziLib_a23_closure'
Apply.o:ghc6140_0.hc:(.text+0x1078): undefined reference to
`templatezmhaskell_LanguageziHaskellziTHziLib_a23_closure'
Apply.o:ghc6140_0.hc:(.text+0x10a1): undefined reference to
`templatezmhaskell_LanguageziHaskellziTHziSyntax_VarP_con_info'
Apply.o:ghc6140_0.hc:(.text+0x14d0): undefined reference to
`__stginit_templatezmhaskell_LanguageziHaskellziTHziSyntax_'
Apply.o:ghc6140_0.hc:(.text+0x292): undefined reference to
`templatezmhaskell_LanguageziHaskellziTHziLib_lamE_info'
Apply.o:ghc6140_0.hc:(.text+0x6ab): undefined reference to
`templatezmhaskell_LanguageziHaskellziTHziLib_a23_info'
Apply.o:ghc6140_0.hc:(.text+0x76b): undefined reference to
`templatezmhaskell_LanguageziHaskellziTHziLib_a23_info'
Apply.o:ghc6140_0.hc:(.text+0x9bc): undefined reference to
`templatezmhaskell_LanguageziHaskellziTHziLib_lamE_info'
Apply.o:ghc6140_0.hc:(.text+0xebb): undefined reference to
`templatezmhaskell_LanguageziHaskellziTHziLib_a23_info'
Apply.o:ghc6140_0.hc:(.text+0xf7b): undefined reference to
`templatezmhaskell_LanguageziHaskellziTHziLib_a23_info'
Apply.o:ghc6140_0.hc:(.text+0x11cc): undefined reference to
`templatezmhaskell_LanguageziHaskellziTHziLib_lamE_info'
C:\app\ghc-6.10.1/libHSrts.a(Main.o):Main.c:(.text+0x7): undefined reference
to `__stginit_ZCMain'
C:\app\ghc-6.10.1/libHSrts.a(Main.o):Main.c:(.text+0x36): undefined
reference to `ZCMain_main_closure'
collect2: ld returned 1 exit status



>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/haskell-cafe/attachments/20090222/bff4135e/attachment-0001.htm


More information about the Haskell-Cafe mailing list