22

I am programming in c++. I have installed mingw. I installed it from the standard installer from mingw website. I am confused between mingw32, mingw, mingw64. What are the differences and how can I check my version. Also when my programs are build, how would I know whether the executables created are 32 bit or 64 bit?

2 Answers 2

31

mingw and mingw32 are for creating executables for 32-bit windows systems. mingw64 is for creating 64-bit executables. Note: this doesn't have to do with what version you are running when you do the build, but what the target system is for the executable you are creating (the system on which you will be running the newly created executable).

Regarding MinGW and MinGW32, here's a snippet from
The MinGW Wiki

"The project's name changed from mingw32 to MinGW is to prevent the implication that MinGW will only works on 32 bit systems (as 64 and higher bit machines become more common, MinGW will evolve to work with them)."

To find out what version you have, go the the associated bin directory and do:

gcc --version

I'd recommend checking out minGW-w64, from here: http://mingw-w64.sourceforge.net/
That projects goal is to "deliver runtime, headers, and libs for developing 64 bit (x64), as well as 32 bit (x86), windows applications using gcc-4.6 or newer versions."

1
  • 7
    On my pc "gcc --version" outputs "gcc.exe (MinGW.org GCC-8.2.0-3) 8.2.0 Copyright (C) 2018 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." So, it says the GCC version, not the MinGW version. How to get the MinGW version? Jul 17, 2019 at 14:29
11

As indicated in the comments to the currently accepted answer gcc --version will not give the target information but rather the version of gcc itself.

Instead gcc -v will print verbose information about the environment of the compiler. Among it you will find either the 64 bit (as shown by "x86_64")

Target: x86_64-w64-mingw32

or the 32 bit (as shown by "i686")

Target: i686-w64-mingw32
2
  • 3
    Can I ask, to which version does each box correspond?
    – David
    Sep 28, 2020 at 21:52
  • 4
    x64 is 64-bit and i686 is the 32-bit version
    – thoni56
    Sep 28, 2020 at 21:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.