Subj : Re: How to start programming with pthreads? To : comp.programming.threads From : Ed Skinner Date : Mon Mar 28 2005 08:10 am On Sun, 27 Mar 2005 08:38:44 -0800, tat wrote: > To continue my previous message. When I compied, the errors are > > ////////// > g++ -c -o maincode.o maincode.cpp > g++ -c -o tat_thread.o tat_thread.cpp g++ -c -o hello.o hello.cpp > > * > * Linking maincode > * > g++ -o maincode maincode.o tat_thread.o hello.o tat_thread.o(.text+0x19a): > In function `TAT_Thread::Detach()': > : undefined reference to `pthread_detach' > tat_thread.o(.text+0x1da): In function `TAT_Thread::Wait()': > : undefined reference to `pthread_join' > tat_thread.o(.text+0x210): In function `TAT_Thread::Stop()': > : undefined reference to `pthread_cancel' > tat_thread.o(.text+0x21e): In function `TAT_Thread::Stop()': > : undefined reference to `pthread_detach' > collect2: ld returned 1 exit status > make: *** [maincode] Error 1 Add "-l pthread" to the line in the Makefile where everything is being linked together (the second g++ line above). .