Previously, I simply compiled with g++ on Ubuntu, pulling the compiler using the batch manager:

 $ sudo apt-get install g++ $ g++ -o main.a main.cpp 

Or on Windows using various IDEs, inside of which, as I was told, costs MinGW.

Now I just want, using the internal console in Windows, to compile natively for them themselves. I read about Cygwin and MinGW, I realized that there was something to it, but there were gaps - it’s not at all clear what I need.

Is it possible, in detail, but better to be very simple, to learn about every opportunity to compile under Windows?

  • And what does Visual Studio not suit you? - VladD
  • @VladD all suits me. I ask about all the available compilation options. I want to find the best for me. And just by the way, MVS looks for me to design only large projects, and now I don’t write anything huge. - D Thr.
  • Well, it seems there can be compiled from the comma without any problems, but I have not tried, to be honest. - VladD
  • Perfectly run from com. Windows lines and g++ and gcc . With the same options. Worth MinGW + Qt. D:\Qt\testfile>g++ -o main.exe main.cpp - andy.37

1 answer 1

Cygwin is an attempt to migrate a UNIX environment to Windows, and MinGW (or the modern version of MinGW-w64 ) focuses only on the GCC compiler .

Further, when compiling a program using Cygwin, under the terms of its license you will link to its dynamic library cygwin1.dll and drag it everywhere behind you, while with MinGW, you will depend only on standard MSVC libraries (by default from msvcrt.dll ).

Since MinGW is only a compiler, there is a separate project - MSYS2 which delivers a lightweight / minimal version of UNIX environment in sufficient size to lead development almost like in UNIX (there is bash , git , curl , etc.). Moreover, utilities for MSYS2 are built using MinGW.

About the differences MinGW from Cygwin, you can still read:

  • Does MSYS2 support the latest standard in the stored version of the compiler? In general, does anyone use such solutions in practice, or does everyone use modified (their) versions of compilers, under different IDEs? - D Thr.
  • In MinGW-w64 comes gcc 5.2, and in simple MinGW - 4.8, if I'm not mistaken. In the IDE can go one or another version. To find out the version of the compiler, simply run the gcc -v command. And what features a particular version of gcc supports can be found in the help. - zed
  • one
    @ DmitriThr. I compile cross-platform projects using MSYS2 in window and standard Linux utilities. It works for me. - Yaroslav