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

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

python - argument 2 to map() must support iteration -

How to wrap some text in a rectangle in QML? -