Home > Back-end >  Consult -- Windowds writing C code in Eclipse tip always find - lpthread
Consult -- Windowds writing C code in Eclipse tip always find - lpthread

Time:09-24

Excuse me each great god, and what is the problem? Just install the Eclipse Neon Release (4.6.0) + MinGW, write a simple code, compile this error, the console information is as follows:
Info: Internal Builder is 2 for build
G + + "- LD: \ \ MinGW \ \ lib" - o MD5_test. Exe Main. O
D:/mingw/bin/../lib/GCC/mingw32/5.3.0/../../../.. Mingw32/bin/ld. Exe: always find - a lpthread
Collect2. Exe: error: ld returned 1 exit status

Don't know why, please feel free to comment!

CodePudding user response:

Due to not bring the pthread library under Mingw, so in eclipse sets the multi-thread dynamic link library, no matter use, the need to download,
ftp://sourceware.org/pub/pthreads-win32/pthreads-w32-2-8-0-release.exe
Unlock pthreads - w32-2-8-0 - release. Exe, the Pre - built. 2 the libpthreadGC2. A libpthreads. The name was changed to a copy to the c: \ mingw \ lib directory,
Pthread. H is copied to the c: \ mingw \ the include directory,

CodePudding user response:

@ normal university a tree grass really solved the problem with your method, worship, but another problem is, I added two lines of code, the results out of the 58 error:
  • Related