1. Go to sourceforge.net/projects/mingw
2. Hit the "Download" green button
3. Save and launch the file to install but be sure to select
"C++ Compiler" as it defaults to off under Select Components
4. Include the path on windows, and you can then use the
gnu-compiler in a command prompt (cmd) windowNOTE: To include the path on Windows
10 you need to:

search for Control Panel,
and go to System and Security/System

click on the left menu
item, Advanced
system settings which brings up a dialog box

in the lower right corner,
click Environment
Variables

edit the "path"
under
"System variables" to include C:\MinGW\bin (you
can use new)

click okay and look to see that C:\MinGW\bin; ... is in your
path, then click okayagain

5. Now bring up a cmd window and type in c++ -v and you
will see it indicates it is using gcc version 6.3.0 (in my case)

Troubleshooting:

If you see libgmp-10.dll is
missing make sure you have checked that base as well as the C++
option are installed:

Test your compiler by using a simple hello world example. Puruse
to the directory (cd to the path of where the files lives).
Ms-Dos is similar to linux, however dir is used
instead of ls to list files
ie. in any text editor save a file labeled helloworld.cpp with the
following content:

You could also compile using a Makefile by running the command
mingw32-make with a Makefile in the directory. A simple makefile
would look as follows (note the white space is a TAB). Typing
mingw32-make would execute the command line.

hello: helloworld.cpp
c++ -o helloword helloworld.cpp

Using the GNU compiler on Windows with OpenGL/glut:

This is fairly straightforward once you have the MinGW files
set up properly. Click here.c++ test.cpp -o test.exe -lopengl32 -lglu32 -lglut32