Download mingw-64 and compile with gcc command under windows
Download address: https://sourceforge.net/projects/mingw-w64/files/mingw-w64/
After downloading the online installer, I was prompted to "cannot download repository.txt". I tried some methods without success, so I recommend downloading the offline package.
1. Download the offline package
http://www.mingw-w64.org/doku.php
Straight chain: x86_64-win32-seh
Second, unzip
The directory structure after decompression is as follows, and the executable file is in the bin
3. Configure environment variables
Configure the decompressed bin directory to the environment variable list. Taking my environment as an example, it is D: \ mingw64 \ bin
4. Verification
Open a new command line window, enter gcc -v to view the current version
So far gcc installation is successful!
reference: