<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 <pthread.h><br>#include <sys/stat.h><br><br>int main(int argc, char *argv[])<br>{<br> // thread stuff<br> pthread_t ctrl_t
;<br> pthread_t supv_t ;<br>...<br>...<br>...<br> /* Create resources and threads */<br> pthread_mutex_init (&mutex, NULL);<br> pthread_cond_init (&cond, NULL);<br> err = pthread_create (&ctrl_t, NULL, ctrl_loop, &r1) ;<br> err = pthread_create (&supv_t, NULL, supv_loop, &r2) ;<br> <br> /* Wait for both threads to finish */<br> pthread_join (ctrl_t, NULL) ;<br> 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>