0

While trying to compile any c++ program I am getting this error says.

C:\Users\Friends\Documents>g++ default.cpp c:/mingw/bin/../lib/gcc/mingw32/5.3.0/../../../../mingw32/bin/ld.exe: cannot find -lpthread collect2.exe: error: ld returned 1 exit status

I just installed latest version of all basic packages from MinGW Installer. What should I do?

gnsd
  • 1
  • The error message suggests you should install the phtread library... But I honestly don't know... There's this package https://packages.debian.org/search?keywords=libpth-dev that you could install with apt-get install libpth-dev. Of course, at your own risk :). PD: I realize you're working on windows... Try and search for the same library in the package installer that came with your compiler collection. – The Marlboro Man Aug 29 '16 at 11:12
  • @TheMarlboroMan He's on *windows* platform. Maybe there is *pthread* package on mingw32 list. – BiagioF Aug 29 '16 at 11:15
  • @BiagioFesta, yep, just saw the C:\Users bit. The MingGW installer should have what he needs, right?. – The Marlboro Man Aug 29 '16 at 11:16
  • 1
    Sorry for the spam but according to this http://www.mingw.org/wiki/pthreads_library there's no pthreads for windows. The link suggests that you try http://sourceware.org/pthreads-win32... If you're using c++ you can go c++11 and use the header that it's actually quite awesome. – The Marlboro Man Aug 29 '16 at 11:21

0 Answers0