Namr2000 Namr2000 - 8 months ago 63
C++ Question

Eclipse MinGW C++ cannot find -lpthread

I am currently trying to install Eclipse for making C++ programs.

I've run into an issue when compiling the premade default hello world program.

The console shows this error:

c:/mingw/bin/../lib/gcc/mingw32/5.3.0/../../../../mingw32/bin/ld.exe: cannot find -lpthread

I am not using the library in my program at all.

Any ideas on how to fix this?


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.

Restart Eclipse, rebuild the project and run it. It should now work.