<div dir="ltr">On Sun, Sep 11, 2011 at 10:56, Captain Freako <span dir="ltr">&lt;<a href="mailto:capn.freako@gmail.com">capn.freako@gmail.com</a>&gt;</span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
I can understand why I&#39;d have to explicitly link against `libHSrts&#39;,<br>
since I&#39;m asking ghc for a shared object library and not an<br>
executable. However, I&#39;m not sure about the following:<br>
- Why do I need to give the `-L/usr/lib/ghc-6.12.3/&#39; option? (It seems<br>
like ghc ought to know about that, implicitly.)<br>
- Why do I need to explicitly link against the 3 standard C libraries:<br>
`m&#39;, `ffi&#39;, and `rt&#39;? (I&#39;ve never needed to do this, previously, when<br>
I was building/testing this project statically.)<br></blockquote><div><br></div><div>The first is because GHC doesn&#39;t link its libraries using -L and basenames, but full path names.  Since you used a basename, you also have to use -L to tell it how to expand the basename.</div>
<div><br></div><div>The second is because those libraries are needed by libHSrts, and since you linked that explicitly you need to link its dependencies explicitly as well.</div><div><br></div></div>-- <br>brandon s allbery                                      <a href="mailto:allbery.b@gmail.com" target="_blank">allbery.b@gmail.com</a><br>
wandering unix systems administrator (available)     (412) 475-9364 vm/sms<br><br>
</div>