问题
I am trying to install MinGW64 on Windows 10. Here is what I tried:
Approach 1
Via http://mingw-w64.org/doku.php
I went to http://mingw-w64.org/doku.php/download/win-builds and from there to http://win-builds.org/doku.php/download_and_installation_from_windows where I downloaded Win-builds 1.5.0. I run the exe and let it install everything. When it gets to install mingw64 it says that the Download failed (no further information). What should I do?
Approach 2
Via https://sourceforge.net/projects/mingw-w64/
I also downloaded mingw-w64-v7.0.0 from https://sourceforge.net/projects/mingw-w64/, extracted the zip but have not idea what to do with the contents:
13.02.2020 13:37 .gitignore
13.02.2020 13:37 31.032 aclocal.m4
13.02.2020 13:37 2.398 AUTHORS
13.02.2020 13:37 <DIR> build-aux
13.02.2020 13:37 625 config.h.in
13.02.2020 13:37 123.961 configure
13.02.2020 13:37 3.268 configure.ac
13.02.2020 13:37 2.326 COPYING
13.02.2020 13:37 <DIR> COPYING.MinGW-w64
13.02.2020 13:37 <DIR> COPYING.MinGW-w64-runtime
13.02.2020 13:37 2.245 DISCLAIMER
13.02.2020 13:37 454 DISCLAIMER.PD
13.02.2020 13:37 745 Makefile.am
13.02.2020 13:37 25.337 Makefile.in
13.02.2020 13:38 <DIR> mingw-w64-crt
13.02.2020 13:38 <DIR> mingw-w64-doc
13.02.2020 13:39 <DIR> mingw-w64-headers
13.02.2020 13:39 <DIR> mingw-w64-libraries
13.02.2020 13:39 <DIR> mingw-w64-tools
Approach 3
From: mingw-w64 installer "the file has been downloaded incorrectly"
In https://stackoverflow.com/a/48519212/4533188 it was said that should download from https://sourceforge.net/projects/mingw-w64/files/mingw-w64/, so I went there downloaded MinGW-W64-install.exe
and ran it. The post says further
Once the compressed file downloaded, you have just to extract and copy/paste the MinGW64 folder( with the pre-compiled librairies) to your chosen folder ( in my case : C:\mingw64)
but I got a lot of files installed to C:\Program Files\mingw-w64\x86_64-8.1.0-posix-seh-rt_v6-rev0\
. So I copied the files of the folder to C:\MinGW64
, but it seems I still do not have it installed.
Approach 4
From How to install MinGW-w64 and MSYS2?
I went to https://www.msys2.org/, downloaded the x86_64
version, went through the steps outlined in https://stackoverflow.com/a/40800825/4533188 - except for point 7. which I substituted with running pacman -S mingw-w64-x86_64-cmake
. This seems to have worked, but the folder C:\MinGW64
is empty and running gcc.exe --version
says, the command could not be found. I have no idea where msys2 installed what and how I have to link/move what to get gcc to run.
回答1:
Regarding your approaches:
- Approach 1 - the win-builds site is out of date and should not be used now.
- Approach 2 - you downloaded source code, only do this if you are set up to build from source.
- Approach 3 - it sounds like you installed it correctly and it is unclear why you feel it is not installed. NOTE - this approach goes more smoothly if you choose the option "MinGW-W64-install.exe" instead of unpacking a zip file; this will also install batch files to the start menu which set up the environment for Windows Command Prompt .
- Approach 4 - again it sounds like you installed it correctly but have a faulty expectation about the install path. MSYS2 packages will go underneath the MSYS2 root directory. And it is not clear where you typed "gcc.exe" (you should just type
gcc
from the MSYS2 mingw-w64 shell, which will be accessible from start menu and desktop shortcut if you chose that during the MSYS2 install), and you probably do not want to skip step 7 (CMake relies on gmake; you could install cmake in addition to make).
For approach 4, this list of steps is slightly better than the list you linked
回答2:
The following approach did work for me. I got there via the link in https://stackoverflow.com/a/39113943/4533188
- Got to https://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win64/Personal%20Builds/mingw-builds/
- Click on the newest version (e.g. 8.1.0)
- Click on x86_64-posix-sjlj
- Download the 7z-Archive
Alternative way of clicking around:
- Got to https://sourceforge.net/projects/mingw-w64/
- Click on files
- Click on x86_64-posix-sjlj of the version you want
- Download the 7z-Archive
Then:
- Unzip the archive
- Inside it there is the folder
mingw64
- move it (and its contents) intoC:\MinGW64
- The gcc can be found at
C:\MinGW64\mingw64\bin\gcc.exe
来源:https://stackoverflow.com/questions/60210917/how-to-install-mingw64-non-of-the-approaches-work