Cannot find -lpthread?

c, eclipse, mingw, pthreads

Solution

The answer to this question by someone who is also missing MinGW pthread library should help you out! Essentially the issue is that the MinGW installer script might not download the lpthread library upon installation. Quoted from link:

Just run and open MinGW Installation Manager, which should be pre-installed with MinGW, select "All Packages" on the left panel, and on the right panel, search for "mingw32-pthreads-w32" packages and install them.

Problem

I am new to C programming. I was trying to use the pthread API to write some concurrent program. I downloaded eclipse IDE for C/C++ Developers, MinGW. I have put all the library, header files into the corresponding location of the MinGW file. When I tried to build the project, there is always an error "cannot find -lpthread", what happened? I have added the "-pthread" to the GCC compiler. I have searched a lot in Google but seems no one have similar problem as me.

Original source

Related problems