<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:times new roman,new york,times,serif;font-size:12pt"><div>Hi,<br><br>I'm relatively new to this and looking to use threads. I have included pthread.h and using the cs2005q3.2-glibc2.5-arm toolchain. The following code won't compile, I get the following error:<br><br>main.o: In function `main':/home/ikey/bob/fred/main.c:679: undefined reference to `pthread_create'<br>:/home/ikey/bob/fred/main.c:680: undefined reference to `pthread_create'<br>:/home/ikey/bob/fred/main.c:683: undefined reference to `pthread_join'<br>:/home/ikey/bob/fred/main.c:684: undefined reference to `pthread_join'<br>collect2: ld returned 1 exit status<br>make: *** [bob] Error 1<br><br><br>// threads<br>#include &lt;pthread.h&gt;<br>#include &lt;sys/stat.h&gt;<br><br>int main(int argc, char *argv[])<br>{<br>&nbsp;&nbsp;&nbsp; // thread stuff<br>&nbsp;&nbsp;&nbsp; pthread_t ctrl_t
 ;<br>&nbsp;&nbsp;&nbsp; pthread_t supv_t ;<br>...<br>...<br>...<br>&nbsp; &nbsp;&nbsp;&nbsp; /* Create resources and threads */<br>&nbsp;&nbsp;&nbsp; pthread_mutex_init (&amp;mutex, NULL);<br>&nbsp;&nbsp;&nbsp; pthread_cond_init (&amp;cond, NULL);<br>&nbsp;&nbsp;&nbsp; err = pthread_create (&amp;ctrl_t, NULL, ctrl_loop, &amp;r1) ;<br>&nbsp;&nbsp;&nbsp; err = pthread_create (&amp;supv_t, NULL, supv_loop, &amp;r2) ;<br>&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; /* Wait for both threads to finish */<br>&nbsp;&nbsp;&nbsp; pthread_join (ctrl_t, NULL) ;<br>&nbsp;&nbsp;&nbsp; pthread_join (supv_t, NULL) ;<br>}<br><br>Have I done anything stupid? Can you not do this with N800, if not, how do you do threads?<br><br>Ian<br></div></div><br>
      <hr size=1> 
Yahoo! Answers - Get better answers from someone who knows. <a
href="http://uk.answers.yahoo.com/;_ylc=X3oDMTEydmViNG02BF9TAzIxMTQ3MTcxOTAEc2VjA21haWwEc2xrA3RhZ2xpbmU">Try
it now</a>.</body></html>