本文介绍了MinGW 5.3.0-2不工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

升级到MinGW 5.3.0-2(实际版本)后,我得到一个bizzare错误





较新的Windows GCC打包器
或,将默认安装pthreads,
提供64位以及32位编译器。 mingw-w64另外还提供更新的
版本的GCC(目前6.2,这是最新的GCC版本)。


I get a bizzare error after upgrading to MinGW 5.3.0-2(actual version)

I checked everything because It's the 5th time i reinstall it and thought it would help

Code::Blocks outputs this:

mingw32-g++.exe -Wall -fexceptions -g  -c C:\Users\Tudor\Documents\C++\test\main.cpp -o obj\Debug\main.o
mingw32-g++.exe  -o bin\Debug\test.exe obj\Debug\main.o   
c:/mingw/bin/../lib/gcc/mingw32/5.3.0/../../../../mingw32/bin/ld.exe: cannot find -lpthread
collect2.exe: error: ld returned 1 exit status
Process terminated with status 1 (0 minute(s), 0 second(s))
2 error(s), 0 warning(s) (0 minute(s), 0 second(s))

Note: if I check the -std=c++11 OR -std=c++14 flags i get output like here: Click me

Is it a problem with the last version of MinGW? If so where can I get the last working version? Or is anything in my computer messed up? I would like to keep this version if its possible to fix it but its getting me crazy

解决方案

You haven't installed the Posix Threads (pthread) library, so the linkercan't find it. The particular Windows GCC packager that you have chosen doesn'tinstall it by default.

Start the MinGW Installation Manager and navigate All Packages -> MinGW-> MinGW Standard Libraries. In the Standard Libraries presented, selectmingw32-pthreads-w32 dev. Then from the menubar select Installation -> Apply Changesand proceed. Make it look like

Newer Windows GCC packagers, e.g. mingw-w64or TDM-GCC, will install pthreads by default andprovide 64- as well as 32-bit compilers. mingw-w64 in addition offers more up-to-dateversions of GCC (currently 6.2, which is the latest GCC release).

这篇关于MinGW 5.3.0-2不工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-19 06:55