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.<div><div><br></div><div>(note that compiling *without* -fvia-C works fine)</div>
<div><br></div><div>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...</div><div><br></div><div>Thanks,</div><div>
Peter</div><div><br></div><div><div><div>c:\temp&gt;ghc -O2 -fvia-C -optc-O3 -fforce-recomp Apply.hs</div><div>Apply.o:ghc6140_0.hc:(.text+0x7d): undefined reference to `templatezmhaskell_LanguageziHaskellziTHziSyntax_VarP_con_info&#39;</div>
<div>Apply.o:ghc6140_0.hc:(.text+0x10d): undefined reference to `templatezmhaskell_LanguageziHaskellziTHziSyntax_VarE_con_info&#39;</div><div>Apply.o:ghc6140_0.hc:(.text+0x19d): undefined reference to `templatezmhaskell_LanguageziHaskellziTHziSyntax_VarP_con_info&#39;</div>
<div>Apply.o:ghc6140_0.hc:(.text+0x571): undefined reference to `templatezmhaskell_LanguageziHaskellziTHziSyntax_VarP_con_info&#39;</div><div>Apply.o:ghc6140_0.hc:(.text+0x609): undefined reference to `templatezmhaskell_LanguageziHaskellziTHziSyntax_VarE_con_info&#39;</div>
<div>Apply.o:ghc6140_0.hc:(.text+0x6c9): undefined reference to `templatezmhaskell_LanguageziHaskellziTHziSyntax_VarE_con_info&#39;</div><div>Apply.o:ghc6140_0.hc:(.text+0x789): undefined reference to `templatezmhaskell_LanguageziHaskellziTHziSyntax_VarE_con_info&#39;</div>
<div>Apply.o:ghc6140_0.hc:(.text+0x82c): undefined reference to `templatezmhaskell_LanguageziHaskellziTHziLib_a23_closure&#39;</div><div>Apply.o:ghc6140_0.hc:(.text+0x868): undefined reference to `templatezmhaskell_LanguageziHaskellziTHziLib_a23_closure&#39;</div>
<div>Apply.o:ghc6140_0.hc:(.text+0x891): undefined reference to `templatezmhaskell_LanguageziHaskellziTHziSyntax_VarP_con_info&#39;</div><div>Apply.o:ghc6140_0.hc:(.text+0xd81): undefined reference to `templatezmhaskell_LanguageziHaskellziTHziSyntax_VarP_con_info&#39;</div>
<div>Apply.o:ghc6140_0.hc:(.text+0xe19): undefined reference to `templatezmhaskell_LanguageziHaskellziTHziSyntax_VarE_con_info&#39;</div><div>Apply.o:ghc6140_0.hc:(.text+0xed9): undefined reference to `templatezmhaskell_LanguageziHaskellziTHziSyntax_VarE_con_info&#39;</div>
<div>Apply.o:ghc6140_0.hc:(.text+0xf99): undefined reference to `templatezmhaskell_LanguageziHaskellziTHziSyntax_VarE_con_info&#39;</div><div>Apply.o:ghc6140_0.hc:(.text+0x103c): undefined reference to `templatezmhaskell_LanguageziHaskellziTHziLib_a23_closure&#39;</div>
<div>Apply.o:ghc6140_0.hc:(.text+0x1078): undefined reference to `templatezmhaskell_LanguageziHaskellziTHziLib_a23_closure&#39;</div><div>Apply.o:ghc6140_0.hc:(.text+0x10a1): undefined reference to `templatezmhaskell_LanguageziHaskellziTHziSyntax_VarP_con_info&#39;</div>
<div>Apply.o:ghc6140_0.hc:(.text+0x14d0): undefined reference to `__stginit_templatezmhaskell_LanguageziHaskellziTHziSyntax_&#39;</div><div>Apply.o:ghc6140_0.hc:(.text+0x292): undefined reference to `templatezmhaskell_LanguageziHaskellziTHziLib_lamE_info&#39;</div>
<div>Apply.o:ghc6140_0.hc:(.text+0x6ab): undefined reference to `templatezmhaskell_LanguageziHaskellziTHziLib_a23_info&#39;</div><div>Apply.o:ghc6140_0.hc:(.text+0x76b): undefined reference to `templatezmhaskell_LanguageziHaskellziTHziLib_a23_info&#39;</div>
<div>Apply.o:ghc6140_0.hc:(.text+0x9bc): undefined reference to `templatezmhaskell_LanguageziHaskellziTHziLib_lamE_info&#39;</div><div>Apply.o:ghc6140_0.hc:(.text+0xebb): undefined reference to `templatezmhaskell_LanguageziHaskellziTHziLib_a23_info&#39;</div>
<div>Apply.o:ghc6140_0.hc:(.text+0xf7b): undefined reference to `templatezmhaskell_LanguageziHaskellziTHziLib_a23_info&#39;</div><div>Apply.o:ghc6140_0.hc:(.text+0x11cc): undefined reference to `templatezmhaskell_LanguageziHaskellziTHziLib_lamE_info&#39;</div>
<div>C:\app\ghc-6.10.1/libHSrts.a(Main.o):Main.c:(.text+0x7): undefined reference to `__stginit_ZCMain&#39;</div><div>C:\app\ghc-6.10.1/libHSrts.a(Main.o):Main.c:(.text+0x36): undefined reference to `ZCMain_main_closure&#39;</div>
<div>collect2: ld returned 1 exit status</div><div><br></div><div><br></div><div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div><div class="Wj3C7c">
<br></div></div></blockquote></div></div></div></div></div>