<div dir="ltr">It works! This is much easier, thank you<br><br>Nicola<br><br><div class="gmail_quote">On Thu, Aug 14, 2008 at 11:30 PM, Agent Zhang <span dir="ltr">&lt;<a href="mailto:agentzh@gmail.com">agentzh@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">2008/8/15 Nicola Squartini &lt;<a href="mailto:tensor5@gmail.com">tensor5@gmail.com</a>&gt;<br>

<div class="Ih2E3d">&gt;<br>
&gt; So I run that gcc command manually adding -lpthread at the end of it end it works,<br>
&gt; &nbsp;I get the static binary. Isn&#39;t it strange? It could be a gcc problem.<br>
<br>
</div>Well, it needn&#39;t be that hacky ;) The following command works for me<br>
and it does essentially the same thing:<br>
<br>
 &nbsp; ghc -i -static -optl-static -optl-pthread -funbox-strict-fields<br>
-fwarn-incomplete-patterns -isrc --make Main -o bin/restyscript<br>
<br>
Please note that without -optl-pthread option, I&#39;ll get exactly the same errors:<br>
<br>
Linking bin/restyscript ...<br>
/usr/lib/gcc/i486-linux-gnu/4.2.3/../../../../lib/librt.a(timer_create.o):<br>
In function `timer_create&#39;:<br>
(.text+0x117): undefined reference to `pthread_once&#39;<br>
/usr/lib/gcc/i486-linux-gnu/4.2.3/../../../../lib/librt.a(timer_create.o):<br>
In function `timer_create&#39;:<br>
...<br>
<br>
-lpthread needs to be put to the end of the argument list to help gcc<br>
or ld solve the symbols properly.<br>
<br>
Hope this helps ;)<br>
<br>
-agentzh<br>
</blockquote></div><br></div>