I. Introduction to MinGW-w64
The full name of MinGW is Minimalist GNU on Windows, which is actually a port of gcc (c/c++ compiler) to the Windows platform, and includes Win32API, so you can compile the source code into executable programs that can run in Windows. It also allows you to use some development tools for the Linux platform that are not available for Windows.
Reasons for choosing it:
- 1. MinGW-w64 is open source software and can be used for free.
- 2. MinGW-w64 is continuously maintained by an active open source community and is not outdated.
- 3. MinGW-w64 supports the latest C standard.
- Uses the Windows C runtime library, so the compiled program does not need a third-party DLL and can be run directly under Windows.
In short it is to run c/c++ on windows press just right. It can be understood as the windows version of gcc, the compiler for c/c++.
Download and Installation of MinGW-w64
1. Download, unzip and install
Official download site:MinGW-w64 – for 32 and 64 bit Windows download | SourceForge.net
Scroll down the page to find the next image in place
- x86_64 refers to a 64-bit operating system, i686 refers to a 32-bit operating system (don’t ask me why it’s not x32!)
- win32 is the protocol for developing programs for windows, posix is the protocol for other systems (e.g. Linux, Unix, Mac OS)
- Exception Handling Models seh (new, only supports 64-bit systems), sjlj (stable, both 64-bit and 32-bit), dwarf (superior to sjlj, only supports 32-bit systems)
- (Anyone who knows what Build revision is for, let me know in the comments section, thanks)
2、Environmental variable configuration
Don’t forget to click on theConfirmed! Confirmed! Confirmed!
3、Verify that the configuration is successful
III. Test c program (optional)
(Conclusion: I personally understand that gcc is a compiler for c/c++, but it is usually only available on Linux. If we want to use it on windows, we have to use it with the help of MinGW. In MinGW official website, you can download zip or exe executable file, but the .exe executable file will download the zip file according to your choice when installing, and the internet speed is not good enough to download the zip file at all, it will report an error, so we can directly select the zip file to download the corresponding version of the zip file. If there is any error, please correct me in the comment section).