olib keep smiling ! | je suis sur un tuto et j'essaie de compiler le premier exemple fournit et ça ne marche deja pas !        vla le code  
  Code :
 - #include <pthread.h>
 - #include <stdio.h>
 - #define NUM_THREADS     3
 - void *BusyWork(void *null)
 - {
 -    int i;
 -    double result=0.0;
 -    for (i=0; i < 1000000; i++)
 -    {
 -      result = result + (double)random();
 -    }
 -    printf("result = %e\n",result);
 -    pthread_exit((void *) 0);
 - }
 - int main (int argc, char *argv[])
 - {
 -    pthread_t thread[NUM_THREADS];
 -    pthread_attr_t attr;
 -    int rc, t, status;
 -    /* Initialize and set thread detached attribute */
 -    pthread_attr_init(&attr);
 -    pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
 -    for(t=0;t < NUM_THREADS;t++)
 -    {
 -       printf("Creating thread %d\n", t);
 -       rc = pthread_create(&thread[t], &attr, BusyWork, NULL);
 -       if (rc)
 -       {
 -          printf("ERROR; return code from pthread_create()
 -                 is %d\n", rc);
 -          exit(-1);
 -       }
 -    }
 
  |  
 
   et vla ce que j'obtiens en tappant " "
  
  
 [olib@localhost olib]$ gcc hello.c
 /home/olib/tmp/ccaLUi4K.o(.text+0x72): In function `main':
 : undefined reference to `pthread_create'
 collect2: ld returned 1 exit status
   |  
 
   qq1 sait me dire où je fais une faute ?
   ps : ça commence bien !        ---------------
			 olib
    |