Hello im getting error while compiling my source code:
But there isCode:Undefined reference to "pthread_create" Undefined reference to "pthred_join"Code:#include <pthread.h>
Hello im getting error while compiling my source code:
But there isCode:Undefined reference to "pthread_create" Undefined reference to "pthred_join"Code:#include <pthread.h>
Are you using gcc?
Originally Posted by gcc manual
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.
sorry i forgot about it
acctualy i was using -lpthread
Are you sure? You shouldn't be getting that if you are on a *nix machine, include the header and link it when you compile on gcc.
You mean link this ?
Code:gcc xxx.o xxxx.o -lpthread -o xxxx
For gcc, use "-pthread -D_XOPEN_SOURCE=700".
-pthread tells gcc to include any compiler and linker flags needed by the platform.
_XOPEN_SOURCE=700 tells all the headers that you're using the latest Posix standard its extensions.
http://pubs.opengroup.org/onlinepubs...ag_15_02_01_02
gg