Reputation: 833
I am trying to install mingw-w64 onto Windows. However I receive an error, "the file has been downloaded incorrectly". Redownloading the setup file again from sourceforge does not fix the problem. Is there an alternative way to install it or am I doing something wrong?
Upvotes: 66
Views: 170779
Reputation: 715
You can directly download the archive of MinGW64 with your chosen configuration:
https://sourceforge.net/projects/mingw-w64/files/mingw-w64/
Once the compressed file is downloaded, you have just to extract and copy/paste the MinGW64 folder (with the pre-compiled libraries) to your chosen folder (in my case: C:\mingw64
).
Upvotes: 47
Reputation: 931
Following this tutorial helped me manually install MinGW for windows : youtube
So the problem for me was that when I tried to use the .exe
installer, it either showed me that,
"the file has been downloaded incorrectly" , or , the /.../bin
folder did not have any files in it.
In the link above, the MinGW files (including the /bin
files) were manually downloaded and identified properly by the Environment Variables
.
Upvotes: 2
Reputation: 1269
Long story short, the official installer is broken and not been fixed for years, so we have to install it manually.
The official download link above would bring you to sourceforge: https://sourceforge.net/projects/mingw-w64/files/Toolchains targetting Win32/Personal Builds/mingw-builds/installer/mingw-w64-install.exe
And in the same folder that contains the installer, there's a repository.txt
. (about this file)
Take a look at it, the installer basically just download and unzip the build from one of these urls within repository.txt
. Choose the url you want and download/upzip it manually. (In my case, I use 8.1.0|x86_64|posix|seh|rev0
setup)
Last, setup the Path
environment variable pointing to your unzipped bin folder, let say C:\mingw64\bin
, and this should do the trick.
Upvotes: 12
Reputation: 1343
I got same error and solved it, after struggling a few hours. You should download MinGW64 via https://winlibs.com/#download-release.
After downloading, You should unzip mingw64 file to a folder(in my case I unzipped it to c disk; C:\mingw64)
And then you have to set up path. for that follow below steps;
Upvotes: 50
Reputation: 101
Finally, I solved this problem by downloading this:http://winlibs.com/
GCC 10.1.0 + LLVM/Clang/LLD/LLDB 10.0.0 + MinGW-w64 7.0.0 - release 3 (LATEST) Win32: 7-Zip archive* | Zip archive Win64: 7-Zip archive* | Zip archive
and set the %path%
After that, I still can't execute gcc correctly, but then I solved the problem by adding this environment variable:
"CGO_ENABLED=1"
I encountered the problem when using this golang package: https://github.com/mattn/go-sqlite3
Upvotes: 6
Reputation: 43
I received the same error. When I re-ran the installer as an adminstrator it was installed successfully.
I also made sure not to add any spaces to the installation path.
Upvotes: 1
Reputation: 77
The problem is with your internet connection and/or ISP. I'm not great at networking so I'll let others be more specific. I tried installing/downloading it using my mobile's data as wifi hotspot and it worked. Hope it helps
Upvotes: -3