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?
-
I had the same problem but chaning version to the second newest (from 7.3.0 to 7.2.0) solved it – Xeverous Apr 20 '18 at 17:04
-
I suggest trying the manual method outlined here: http://www.mingw.org/wiki/HOWTO_Install_the_MinGW_GCC_Compiler_Suite I had the same issue and that's what I did. You can also try this setup tool http://cfhcable.dl.sourceforge.net/project/mingw/Installer/mingw-get-setup.exe I had issues with both tools hence the manual way which is very painful. Goodluck. – user264431 Sep 27 '17 at 23:24
-
I couldn't execute from download folder in win10, copied the exe file to c/temp and executed from there fine – Sergio Solorzano Feb 27 '22 at 09:17
7 Answers
Old post but same problem, the installer doesn't seem to work.
I give the solution which works for me
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 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)

- 685
- 9
- 9
-
3
-
1At https://sourceforge.net/projects/mingw-w64/files/ you can find platform specific setup downloads under MinGW-W64 GCC-x.x.x. For me (Win 7-64bit) "x86_64-posix-seh" worked, – arshad Aug 03 '20 at 02:07
-
2
-
1Did't find bin folder in this method. Timur Turbil's answer works for me. – qloveshmily Jul 01 '22 at 09:28
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;
- open settings.
- Search for Edit environment variables for your account.
- choose path variable and then select edit.
- Select New and add the Mingw-w64 folder path(bin folder). In my case, I added (C:\mingw64\bin).
- Select OK to save the updated path. And reopen your cmd, then check if everything is good by typing; gcc --version

- 1,145
- 10
- 13
-
-
-
1This method looked sketchy, but it indeed worked and I recommend it as a solution. If winlibs didn't have a few things to help me validate it, I woulda avoided as possible virus....even then I still see this as taking a chance. It had a wiki page which granted credibility, but even a fake wiki page and multiple fake variable downloadable releases on the main site wouldn't surprise me at this point. – kite May 09 '22 at 00:18
-
Thank you. All the other methods did not work. You linked to the correct URL to simply unzip it and build a path variable. – user3669653 Aug 15 '22 at 21:10
-
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.

- 907
- 10
- 16
-
1Great answer. I do have one question however. Which environment variable? PATH? – Rugnir May 17 '22 at 23:56
-
1This is the only correct answer, because it installs exactly what the installer would. The other answers install some other MinGW-w64 distributions that may or (more often) may not work for the intended purpose. – AndreKR Mar 26 '23 at 22:16
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

- 101
- 1
- 6
-
This ([file downloaded incorrectly](https://semicolon.dev/tutorial/webdev/mingw-file-downloaded-incorrectly)) is one of the best tutorial on the subject as it points out the only solution that worked for me. And its [video](https://www.youtube.com/watch?v=Zcy981HhGw0) counterpart here. – InfiniteStack Jul 30 '22 at 04:29
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
.

- 441
- 5
- 11
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.

- 33
- 7
-
2I both ran the installer as an administrator and made sure that the path didn't have any spaces, it didn't fix it for me unfortunately. – MyNameIsTrez Mar 30 '22 at 22:05
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

- 77
- 1
- 2
- 11
-
3I was able to solve it by following this [how to properly install mingw](https://www.youtube.com/watch?v=Zcy981HhGw0) video tutorial. It's not an internet issue. I struggled with this a bit, redownloaded the file, etc – InfiniteStack Apr 30 '22 at 16:13