Messages in this thread | | | Date | Fri, 17 Mar 2000 15:07:14 +0530 (IST) | From | "B.S.Manoj" <> |
| |
hi, Could anyone help me out of this Thread
I tried to compile this small sample code ------------------------------------- #include <stdio.h> #include <pthread.h>
pthread_t a_thread; pthread_attr_t a_thread_attribute; void thread_function(void*argument); char *some_argument;
int flag =0;
main(); {
pthread_create(&atherad, &athread_attribute, (void*)&thread_function, (void*)&some_argument);
while(flag != 1) ;
printf("Thread1 exiting.."); }
void thread_function(void *argument) { int count =0; while(count<10) { printf("Thread 2 is running %d",count); }
flag =1;
printf("Thread 2 is exiting.."); } ------------------------------------------- I tried to compile this using
gcc Sample.c
But I got some error like
/tmp/ccoocq3y.o(.text+0x18): undefined reference to 'pthread_create' collect2 returned 1 exit status
even with -l option it is not working.
/usr/lib/libpthread.so and /usr/lib/libpthread.a are available.
What could be the problem here?, Could any one can suggest a way out.
thanks in advance
-bsm.. --------------------------------------------- bsmanoj@peacock.iitm.ernet.in bsmanoj@iname.com ----------------------------------------------
- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/
| |