Undefined reference to `sem_init’

In this article let’s discuss about Undefined reference to `sem_init’. Let’s go through the following methods without any delay.

Method 1:

If you are on a linux system, you will need to compile and link with 
the -pthread flag to link the pthreads library.

$ gcc -pthread FileName.c

Hope the above solution works.

Realted Posts : How to stop git asking for username and password