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

Popular posts from this blog

google chrome - Developer tools - How to inspect the elements which are added momentarily (by JQuery)? -

angularjs - Showing an empty as first option in select tag -

php - Cloud9 cloud IDE and CakePHP -