An easy way to get the equivalent of GLUT compiled with MinGW is to use freeglut. See the Community_Supplied_Links [3] page and look under Libraries for the link to the freeglut home page and source code. Build with commands such as the following:
./configure --with-x=no
make
make install
UNDER CONSTRUCTION
NOTE: This page is based on the following master page:
http://www.joshuaburkholder.com/glut/ [4]
Downloads:
- MinGW and MSYS ( http://sourceforge.net/projects/mingw/ [5] ) - for gcc, windres, mingw32-make, msys, cp, and rm.
- GLUT for Win32 ( http://www.xmission.com/~nate/glut.html [6] ) - for the GLUT for Win32 source files.
- makefile ( http://www.joshuaburkholder.com/glut/makefile [7] ) - to make the GLUT for Win32 AFTER two small changes have been made to the GLUT for Win32 source files.
- OPTIONAL: Eclipse IDE for C/C++ Developers ( http://www.eclipse.org/downloads/ [8] ) - for a C/C++ development environment that wraps around MinGW.
- OPTIONAL: get-path-info.js ( http://www.joshuaburkholder.com/glut/get-path-info.js [9] ) - to troubleshoot DLL and EXE conflicts caused by multiple folders listed in the PATH environment variable having DLLs or EXEs with the same name.
Outline:
1) Download and Install MinGW and MSYS
2) Download and Unzip the GLUT-for-Win32 Source Code
3) Download the Makefile
4) Make Two Modifications to the GLUT-for-Win32 Source Code
5) Make the GLUT for Win32
6) Install the GLUT for Win32
7) Test the GLUT for Win32
Procedure:
1) Download and Install MinGW and MSYS
- Download the Automated MinGW Installer from sourceforge.net:
http://sourceforge.net/projects/mingw/ [5]
NOTE: During the writing of this procedure, the following Automated MinGW Installer was used:
mingw-get-inst-20101030.exe
- Run the Automated MinGW Installer.
NOTE: The Automated MinGW Installer does not require administrative rights.
- Choose to download the latest repository catalogues.
- Choose to install into a folder with no spaces in its path (i.e. C:\MinGW).
- Select all components.
NOTE: At a minimum, select the C++ Compiler and MSYS Basic System in addition to the default C Compiler.
- Install the components.
NOTE: The latest repository catalogues will be downloaded and read. Then, the latest components will be downloaded and installed.
NOTE: During the writing of this procedure, version 4 . 5 . 0 of gcc and g++ was installed.
For detailed instructions on how to complete this step: http://www.joshuaburkholder.com/glut/step_1/ [10]
2) Download and Unzip the GLUT-for-Win32 Source Code
~~~~TODO~~~~
http://www.xmission.com/~nate/glut.html [6]
During the writing of this procedure, the following source code was used:
http://www.xmission.com/~nate/glut/glut-3.7.6-src.zip [11]
For detailed instructions on how to complete this step: http://www.joshuaburkholder.com/glut/step_2/ [12]
3) Download the Makefile
~~~~TODO~~~~
Right click the following link and save the file:
http://www.joshuaburkholder.com/glut/makefile [7]
Save the makefile to the root of the unzipped GLUT-for-Win32 folder (i.e. glut-3.7.6/ where the README is located).
For detailed instructions on how to complete this step: http://www.joshuaburkholder.com/glut/step_3/ [13]
4) Make Two Modifications to the GLUT-for-Win32 Source Code
Make the following modifications:
1. Add the following lines to include/GL/glut.h starting at line 12:
#ifdef __MINGW32__
#define APIENTRY __stdcall
#define CALLBACK __stdcall
#endif
2. Comment out line 21 in lib/glut/win32_winproc.c so that it reads:
//#include <crtdbg.h>
Note: After these modifications have been made glut.h and win32_winproc.c should look like the following:
- http://www.joshuaburkholder.com/glut/glut.h [14]
- http://www.joshuaburkholder.com/glut/win32_winproc.c [15]
For detailed instructions on how to complete this step: http://www.joshuaburkholder.com/glut/step_4/ [16]
5) Make the GLUT for Win32
~~~~TODO~~~~
In the MinGW Shell (also known as MSYS), cd to the root of the GLUT-for-Win32 folder (i.e. glut-3.7.6/ where the makefile was saved).
make
or
mingw32-make
This will make glut32.dll and libglut32.a.
For detailed instructions on how to complete this step: http://www.joshuaburkholder.com/glut/step_5/ [17]
6) Install the GLUT for Win32
~~~~TODO~~~~
make install
or
mingw32-make install
This will install glut.h in /mingw/include/GL, glut32.dll in /mingw/bin, and libglut32.a in /mingw/lib.
For detailed instructions on how to complete this step: http://www.joshuaburkholder.com/glut/step_6/ [18]
7) Test the GLUT for Win32
~~~~TODO~~~~
make test
or
mingw32-make test
This will build and run the gears program in progs/mesademos/. The following window will be produced:

For detailed instructions on how to complete this step: http://www.joshuaburkholder.com/glut/step_7/ [19]
References:
- Using GLUT with MinGW ( http://www.transmissionzero.co.uk/computing/using-glut-with-mingw/ [20] )
- HOWTO Use Mark J. Kilgard's OpenGL Utility Toolkit (GLUT) with MinGW ( http://www.mingw.org/wiki/HOWTO_Use_Mark_J_Kilgards_OpenGL_Utility_Toolkit_GLUT_with_MinGW [21] )
- MSVC and MinGW DLLs ( http://www.mingw.org/wiki/MSVC_and_MinGW_DLLs [22] )
- MS resource compiler ( http://www.mingw.org/wiki/MS_resource_compiler [23] )
UNDER CONSTRUCTION