<div dir="ltr">would --dynamic-too work too?</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Jan 2, 2014 at 5:36 PM, Yorick Laupa <span dir="ltr"><<a href="mailto:yo.eight@gmail.com" target="_blank">yo.eight@gmail.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi Carter,<div><br></div><div>Someone figured it out on #ghc. It seems we need to compile with -dynamic when having TH code now (<a href="https://ghc.haskell.org/trac/ghc/ticket/8180" target="_blank">https://ghc.haskell.org/trac/ghc/ticket/8180</a>)</div>


<div><br></div><div>About a snippet, I working on that ticket (<a href="https://ghc.haskell.org/trac/ghc/ticket/7021" target="_blank">https://ghc.haskell.org/trac/ghc/ticket/7021</a>) so it's based on the given sample:</div>

<div><br>
</div><div>-- Tuple.hs</div><div><div>{-# LANGUAGE ConstraintKinds, TemplateHaskell #-}</div><div><br></div><div>module Tuple where</div><div><br></div><div>import <a href="http://Language.Haskell.TH" target="_blank">Language.Haskell.TH</a></div>


<div><br></div><div>type IOable a = (Show a, Read a)</div><div><br></div><div>foo :: IOable a => a</div><div>foo = undefined</div><div><br></div><div>test :: Q Exp</div><div>test = do</div><div>    Just fooName <- lookupValueName "foo"</div>


<div>    info         <- reify fooName</div><div>    runIO $ print info</div><div>    [| \_ -> 0 |]</div></div><div>--</div><div><br></div><div>-- Main.hs</div><div><div>{-# LANGUAGE TemplateHaskell #-}</div><div>module Main where</div>


<div><br></div><div>import Tuple</div><div><br></div><div>func :: a -> Int</div><div>func = $(test)</div><div><br></div><div>main :: IO ()</div><div>main = print "hello"</div></div><div><br></div><div>--</div>


</div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><br><div class="gmail_quote">2014/1/2 Carter Schonwald <span dir="ltr"><<a href="mailto:carter.schonwald@gmail.com" target="_blank">carter.schonwald@gmail.com</a>></span><br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Did you build ghc with both static and dynamic libs? Starting in 7.7/HEAD, ghci uses Dylib versions of libraries, and thus TH does too.  What OS and architecture is this, and what commit is your ghc build from?<div><br></div>



<div>Last but most importantly, if you don't share the code, we can't really help isolate the problem. <div><div><span></span><br><br>On Thursday, January 2, 2014, Yorick Laupa  wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">



<div dir="ltr">Hi,<div><br></div><div>Oddly I can't compile code using TH with GHC HEAD. Here's what I get:</div><div><br></div><div><div>cannot find normal object file ‛./Tuple.dyn_o’</div><div>    while linking an interpreted expression</div>




</div><div><br></div><div>I'm currently working on a issue so I compile the code with ghc-stage2 for convenience.</div><div><br></div><div>I found an old ticket related to my problem (<a href="https://ghc.haskell.org/trac/ghc/ticket/8443" target="_blank">https://ghc.haskell.org/trac/ghc/ticket/8443</a>) but adding -XTemplateHaskell didn't work out.</div>




<div><br></div><div>The code compiles with ghc 7.6.3.</div><div><br></div><div>Here's my setup: Archlinux (3.12.6-1)</div><div><br></div><div>Any suggestions ?</div><div><br></div><div>--Yorick</div><div><br></div></div>




</blockquote></div></div></div>
</blockquote></div><br></div>
</div></div></blockquote></div><br></div>