Mingw W64 Offline Installer

Berkeley Electronic Press Selected Works. MinGW's official website mingw-w64.org provides various builds, but I maintain my own distro because I demand complete control. (It's a long story, but mingw-w64 forked from mingw.org. Although my distro was based on mingw.org for many years, I now consider mingw-w64 to be the one true MinGW.).


  • 2TDM-GCC
  • 4Development Tools

Overview

A compiler toolchain is what Code::Blocks uses to turn the code you type into it into numbers that the computer understands. As a compiler toolchain is a very complex undertaking it is not part of Code::Blocks itself but rather is a separate project that Code::Blocks then uses. The kind of compiler toolchains talked about on this page are 'MinGW' toolchains. Which means 'Minimalist GNU for Windows.' And 'GNU' expands to 'GNU's Not Unix.' More information about the GNU project can be found on the GNU Home Page.

For most MinGW-based compiler toolchains, having your toolchain in your PATH is important because it means that during development the toolchain libraries will be accessible by default to your programs as you develop them and also makes it easier to use utilities such as CMake as they will be able to find your compiler toolchain. When you actually distribute your programs to other computers then you will copy the needed .dll files out of your toolchain directory and include them as part of your installer. On your machine they are in your PATH so you always have them, on your users computers they won't have the compiler toolchain so there you provide the .dll files with your program.

TDM-GCC

TDM-GCC is the toolchain that will be used as the example for this guide. TDM-GCC statically links the required toolchain libraries into your final executable. Which means that when you create your installer for your final program there are less files to include - they are built into your executable itself. The Code::Blocks team recommends TDM-GCC.

Installation

Download the on-demand installer and run it.

Go through the installation pages, the red arrows are all the default options which we will be keeping and the last blue arrow is to indicate that you will be putting TDM-GCC into your system's PATH.

Mingw W64 Download

Once you are ready, click Install to proceed.

Code::Blocks Configuration

Go to your Compiler settings:

And then under the 'Toolchain executables' tab (red arrow), click on the ellipsis ('...', blue arrow) and choose the root directory where you installed TDM-GCC 32-bit. Once you have that directory chosen, in the 'Program Files' sub-tab (green arrow) area fill out the fields as shown. If you aren't using the TDM-GCC toolchain there might be minor variation in the executable names. If you choose the blue arrow ellipsis first then for each ellipsis you click on under 'Program Files' you will already be in your TDM-GCC bin directory where the actual programs are.

Now, go to your Debugger settings:

Choose your default debugger (red arrow), and then fill in the Executable path for it as shown for TDM-GCC 32-bit (blue arrow).

Summary

You now have a Code::Blocks environment that is configured to use TDM-GCC 32-bit properly. Using this guide as a template you can easily set up alternative compiler toolchains no matter the source - just follow the same basic procedure.

Alternative MinGW Compiler Toolchains

MinGW - The original project.

MinGW-Builds ➡ In, 'Toolchains targeting Win32 or Win64,' ➡ 'Personal Builds,' ➡ 'mingw-builds,' ➡ Version, ➡ Threading Model, ➡ Exception Model, ➡ Revision.

Mingw-w64 - The parent project of MinGW-Builds, includes much more than is necessary - MinGW-Builds will usually suffice instead of the full works.

MinGW Equation - A package that also provides OpenMP.

Development Tools

Normally you should not need many of these tools. ZIP is convenient, especially when: building Code::Blocks itself, but other than that these tools only serve specialized purposes.

UnxUtils

GnuWin32

ZIP

  • zip-3.0.0 32-bit or zip-3.0.0 64-bit
Retrieved from 'http://wiki.codeblocks.org/index.php?title=MinGW_installation&oldid=9322'

1、 What is mingw-w64?
The full name of MinGW is: minimalist GNU on windows. In fact, GCC, the classic open source c language compiler, is ported to the windows platform and contains the Win32 API, so the source code can be compiled into executable programs that can run in windows. In addition, you can also use some development tools under Linux platform that Windows does not have. In a word, MinGW is the Windows version of GCC.

The above is the introduction of MinGW. The difference between mingw-w64 and MinGW is that MinGW can only compile and generate 32-bit executable programs, while mingw-w64 can compile and generate 64 bit or 32-bit executable programs.
Because of this, MinGW has been replaced by mingw-w64, and MinGW has already stopped updating. The built-in GCC has stagnated at version 4.8.1, while the built-in GCC of mingw-w64 has been updated to version 6.2.0.

2、 Why use mingw-w64?
1. Mingw-w64 is open source software, which can be used free of charge.
2. Mingw-w64 is maintained by an active open source community, so it will not be out of date.
3. Mingw-w64 supports the latest C language standard.
4. Mingw-w64 uses the C language runtime library of windows, so the compiled program does not need a third-party DLL, and can run directly under windows.
5. Those famous open-source ides only encapsulate the mingw-w64, making it have a friendly graphical interface and simplify the operation, but the internal core is still mingw-w64.

Mingw-w64 is a stable, reliable and continuously updated C / C + + compiler, which can save you a lot of trouble, don’t worry about not keeping up with the times, don’t worry about the compiler itself has bugs, and you can write programs at ease.

3、 What is mingw-w64 suitable for?
For those familiar with mingw-w64, it can compile any C program. But for the average person, the mingw-w64 is too simple to have a graphical user interface. This makes people who are used to using the mouse feel very painful. Although there are some configurations that allow the mingw-w64 to have a graphical user interface, that process is cumbersome.

In addition, when compiling complex programs, you need to be able to write makefiles. Otherwise, you can only compile one file for one file. You can imagine how hard it will be.
But for beginners of C language, mingw-w64 is the right compiler. At least the black command prompt interface has a programming atmosphere and feels cool.

At the beginning of learning C language, all the code is usually written in one file. As long as you enter a few simple commands, you can use mingw-w64 to compile into an executable file. Although compilers such as vs2015 can be compiled by clicking the mouse, they will automatically generate a large number of engineering files, leaving beginners confused. Mingw-w64 generates only one executable.

If we describe the compilers such as mingw-w64 and vs2015, then mingw-w64 is manual, while the compilers such as vs2015 are automatic. Therefore, the compilation process of mingw-w64 is more intuitive and easy to understand, and it is also more suitable for C language learning.
All in all, for ordinary people, mingw-w64 is suitable for learning C language, and vs2015 is better for real work. Of course, if you are working under Linux, code:: blocks may be an option, but the biggest possibility is that you must be accustomed to using gcc to compile programs.

4、 Download and install mingw-w64

Before you start the installation, make sure you meet the following conditions.
1. Your computer is connected to the network.
2. Your computer hard disk has 500MB of free space.
3. You have plenty of time now. (due to your current network speed, the installation process may take more than 10 minutes or 1 hour.)

If you confirm that you meet the above conditions, then you can start to install the mingw-w64.

Note: the pictures in the tutorial are the original scale screenshots of the actual installation. If you can’t see the prompt in the pictures, you can enlarge the pictures without affecting the clarity. To view a large picture, just click on the picture and it will jump to the original size picture page. If the previous method fails, you can still enlarge the page function and enlarge the picture through the browser. For example, in Chrome browser, you can press and hold Ctrl key, and then scroll the mouse wheel to enlarge the page.

Selection criteria:

I686 for 32-bit system, x86 for 64 bit system
Thread model: Win32: no C + + 11 multithreading feature, POSIX: support c + + 11 multithreading feature
Exception handling model: recommended for 32-bit system: dwarf, recommended for 64 bit system: SEH
Because the test environment is a 64 bit system, it is recommended to configure x86 ʄ POSIX sEH

Developepaer local download

Software name:
Mingw-w64 for windows (x86-8.1.0-release-posix-seh-rt-v6-rev0.7z) offline installation package with installation tutorial
Software size:
48MB
Updated:
2019-10-05
Software name:
Mingw-w64 for windows (x86-8.1.0-release-win32-seh-rt-v6-rev0.7z) offline installation package with installation tutorial
Software size:
48MB
Updated:
2019-10-05

1. Official download

If you can install it online, you’d better install it online.

If you can connect to the official website, you can choose to download it from the official website,

Address: https://osdn.net/projects/mingw/releases/

Mingw W64 Offline Installer Download

https://sourceforge.net/projects/mingw-w64/files/

Download from here, select the file you want to download.

As shown in the figure, my choice here is x86 ʄ POSIX sEH

2、7-zip

The downloaded file is a 7z file. You can unzip it directly. If you don’t have a 7z unzip tool, you can download one.

https://www.7-zip.org/

Go to the official website to download. My system is 64 bit.

Mingw

Install 7-Zip.

My one is installed on disk D, as shown in the figure:

3. Decompression

After the 7-Zip installation, unzip the files in the directory.

You can choose to copy the downloaded x86-8.1.0-release-posix-seh-rt-v6-rev0.7z file to the 7-Zip directory.

Mingw Minimalist Gnu For Windows

Use the command to extract.

7z x x86_64-8.1.0-release-posix-seh-rt_v6-rev0.7z -o./

Mingw W64 Offline Installer

Command to extract the file to the current directory.

After unzipping, you will get a mingw64 folder and copy it to the directory you want to install.

4. Environment variable

Download Mingw 64 Offline Installer

After decompression, you need to configure environment variables

Add your mingw64 / bin under path, for example: D: mingw64 bin

Use gcc-v in the CMD window to view.

The official installation version provides a bat to set path

echo off
set PATH=d:Program Files (x86)mingw-w64i686-8.1.0-win32-dwarf-rt_v6-rev0mingw32bin;%PATH%
rem echo %PATH%
rem cd “d:Program Files (x86)mingw-w64i686-8.1.0-win32-dwarf-rt_v6-rev0mingw32bin”
cd “C:”
“C:Windowssystem32cmd.exe”

You can set your own path according to your needs. This article introduces it. I hope you can support developepaer in the future.