Hi,

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:

main.o: In function `main':/home/ikey/bob/fred/main.c:679: undefined reference 
to `pthread_create'
:/home/ikey/bob/fred/main.c:680: undefined reference to `pthread_create'
:/home/ikey/bob/fred/main.c:683: undefined reference to `pthread_join'
:/home/ikey/bob/fred/main.c:684: undefined reference to `pthread_join'
collect2: ld returned 1 exit status
make: *** [bob] Error 1


// threads
#include <pthread.h>
#include <sys/stat.h>

int main(int argc, char *argv[])
{
    // thread stuff
    pthread_t ctrl_t ;
    pthread_t supv_t ;
...
...
...
      /* Create resources and threads */
    pthread_mutex_init (&mutex, NULL);
    pthread_cond_init (&cond, NULL);
    err = pthread_create (&ctrl_t, NULL, ctrl_loop, &r1) ;
    err = pthread_create (&supv_t, NULL, supv_loop, &r2) ;
    
    /* Wait for both threads to finish */
    pthread_join (ctrl_t, NULL) ;
    pthread_join (supv_t, NULL) ;
}

Have I done anything stupid? Can you not do this with N800, if not, how do you 
do threads?

Ian




      __________________________________________________________
Sent from Yahoo! - the World's favourite mail http://uk.mail.yahoo.com
_______________________________________________
maemo-developers mailing list
maemo-developers@maemo.org
https://lists.maemo.org/mailman/listinfo/maemo-developers

Reply via email to