Which MinGW file to use as a C++ compiler

These follow gcc naming conventions.

  • c++.exe is a traditional name for the system c++ compiler
  • g++.exe and gcc.exe are the names for the gcc compilers that compile for the “current system”
  • mingw32-* versions are the names for the compilers that cross-compile to the “mingw” target. In this case this is the same as the system target.
  • An then mingw32-gcc-4.1.exe is “gcc for mingw target version 4.1”

You should typically compile C code with a “gcc” variant, and c++ code with a “g++” variant.

Use -o filename in order to specify the output filename, the default is a.exe

Leave a Comment

tech