Undefined Reference to `pthread_init 'When Using -lpthread Flag:

I compile using:

gcc -o outfile infile.c -lpthread

and only undefined link pthread_init.

I tried using -pthreadinstead -lpthread, according to some suggestions on the Internet.

I am including<pthread.h>

Any ideas?

+3
source share
1 answer

Do not call pthread_init(). This is not necessary for Linux.

+4
source

All Articles