c - Undefined reference to pthread_create() -
this question has answer here:
i'm working on linux.
#include <pthread.h> void *dealwithuser(void *t); int main(int argc,char **argv){ int rc; rc = pthread_create(&threads[t ++],null,dealwithuser,(void *)connfd); }
while compiling, gcc shows "undefined reference 'pthread_create'"
you can try adding -lpthread
after gcc command
Comments
Post a Comment