简体   繁体   English

在Windows 8上修复MinGW安装

[英]Fixing MinGW Installation on Windows 8

While helping my friend spin up MinGW and a C++ environment on his Windows 8 computer, I ran the get-mingw script and waited as it ran through all the mirrors for required downloads. 在帮助我的朋友在他的Windows 8计算机上启动MinGW和C ++环境时,我运行了get-mingw脚本,并等待它通过所有镜像运行以进行所需的下载。 However, three downloads completely failed: 但是,三个下载完全失败:

  • libltdl - installer script hung and then moved on after pressing "OK" libltdl安装程序脚本挂起,然后按“确定”后继续
  • automake-1.11 - installer script tried finding 1.10, then 1.9, then 1.8, then 1.7 (all of which failed) until finally settling on 1.6 automake-1.11安装程序脚本尝试先找到1.10,然后是1.9,然后是1.8,然后是1.7(所有这些都失败了),直到最终稳定到1.6
  • mktemp - script hung and moved on after pressing "OK" mktemp脚本在按下“确定”后挂起并继续运行

In all three cases, the script gave me a nice error log upon completion, showing that a majority of packages had been downloaded and installed except for these three, which showed up as errors. 在所有这三种情况下,该脚本在完成时都为我提供了一个不错的错误日志,表明除这三个错误外,大多数软件包都已下载并安装。 However during the installation process I had simply gone to the MinGW sourceforge page and manually found and downloaded each .bin.tar.lzma file that was missing. 但是,在安装过程中,我只是转到MinGW sourceforge页面并手动找到并下载了每个丢失的.bin.tar.lzma文件。

Now that I have them, is there a good accepted way to unpack and plug them into my friend's existing MinGW install? 现在我有了它们,是否有一种很好的可接受的方法来将它们解包并将其插入我朋友的现有MinGW安装中? In case it's tough, I'm comfortable with unix and dos command line so I'll be able to move executables into the MinGW/bin folder if that's what's needed, I just want to check for the best way to 'fix' the install. 万一遇到困难,我对unix和dos命令行很满意,因此如果需要的话,我可以将可执行文件移至MinGW / bin文件夹中,我只想检查“修复”安装的最佳方法。

As a side note - even though the error log says these are required packages, adding MinGW/bin/ to the PATH still allows for use of gcc and g++ , although not make (possibly because of automake failure?). 附带说明-尽管错误日志说这些是必需的软件包,但将MinGW / bin /添加到PATH仍允许使用gccg++ ,尽管不是make (可能是由于automake失败?)。 Is this standard behavior? 这是标准行为吗?

Firstly, the package issue can be fixed by using the MinGW installer - keep the packages selected and go to "apply changes" and the script will probably try to redownload the missing packages. 首先,可以使用MinGW安装程序解决软件包问题-保持选中软件包并转到“应用更改”,脚本可能会尝试重新下载丢失的软件包。 I think the original problem was probably just a shoddy wifi connection during repository connection. 我认为最初的问题可能只是存储库连接期间的伪劣wifi连接。

However, I then ran into a problem where I tried to run gcc and it gave me a missing -lpthread error ... but this question was able to help me fix that, and gcc and g++ are working fine now (haven't opened and tested Eclipse yet though). 但是,然后我遇到了一个问题,尝试运行gcc ,它给了我一个missing -lpthread错误的提示……但是这个问题能够帮助我解决问题,并且gccg++现在可以正常工作了(尚未打开)并测试了Eclipse)。 Just in case of link decay, the issue I cited arises from the MinGW installer script not downloading the lpthread library upon installation. 只是在出现链接衰减的情况下,我引用的问题是由于MinGW安装程序脚本在安装时未下载lpthread库而引起的。 To fix that issue, 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. 只需运行并打开应该随MinGW一起预安装的MinGW Installation Manager,在左侧面板上选择“所有软件包”,然后在右侧面板上搜索“ mingw32-pthreads-w32”软件包并安装它们。

I think the Installation Manager has libpthread and pthread available for install, and pthread libs were the ones that seemed to solve it for me. 我认为Installation Manager可以使用libpthreadpthread进行安装,而pthread库似乎是为我解决的库。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM