As everyone knows, MS Visual C++/ Visual Studio compiler, linker, builder error & warning reports are way too difficult to understand & debug. So I was searching for a GCC/G++ compiler for windows & found “MinGW” – “Minimalist GNU for Windows”. It is THE GCC/G++ for windows.
Tested OK. Works exactly like the GCC for linux… using the command prompt of windows as the terminal.
In addition, DevC++ is a GUI version of MinGW, which implies it uses GCC/G++. Its IDE helps to build, organise & handle bigger projects.
2. When you run this installer, it’ll ask for –
Go for “Download only”.
Approx 74MB of data will be downloaded.
3. After download, run the installer again & this time select “Download & install”.
It’ll ask for the packages you want like g++, java compiler, ada compiler etc. Select the required & proceed.
4. Now, you need to add this MinGW to system path. For this, goto
My Computer-> Right click-> Properties-> Advanced tab-> Environmental Variables-> System Variables
Select “Path” -> Edit
Then add the folder where MinGW is extracted. Suppose it is the default C:\MinGW, then add
at the end. OK & close.
Your MinGW is installed & ready to use.
5. To compile a C/C++ file, open Command prompt & cd to the folder where the .c or .cpp file is stored. then type:
(for C file)
gcc filename.c -o output_filename.exe
(for C++ file)
g++ filename.cpp -o output_filename.exe
If -o output_filename.exe is not used then it’ll create a default “a.exe” file in that folder.
6. Run the exe. That’s it.
For any further doubts, refer to MinGW documentation.