Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

mingw-w64 installer "the file has been downloaded incorrectly"

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?

like image 906
Crook Avatar asked Sep 27 '17 19:09

Crook


4 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)

like image 59
demiton Avatar answered Nov 18 '22 03:11

demiton


I got same error and solved it, after struggling a few hours. You should download MinGW64 via https://winlibs.com/#download-release. enter image description here

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;

  1. open settings.
  2. Search for Edit environment variables for your account.
  3. choose path variable and then select edit.
  4. Select New and add the Mingw-w64 folder path(bin folder). In my case, I added (C:\mingw64\bin).
  5. Select OK to save the updated path. And reopen your cmd, then check if everything is good by typing; gcc --version
like image 23
Timur Turbil Avatar answered Nov 18 '22 01:11

Timur Turbil


Long story short, the official installer is broken and not been fixed for years, so we have to install it manually.


installer_download_link

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) repository

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) repository.txt

Last, setup the Path environment variable pointing to your unzipped bin folder, let say C:\mingw64\bin, and this should do the trick.

like image 9
Rohim Chou Avatar answered Nov 18 '22 01:11

Rohim Chou


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

like image 5
meowalien Avatar answered Nov 18 '22 03:11

meowalien