Revision of HOWTO Compile the OpenGL Utility Toolkit (GLUT) for Win32 with MinGW from 2010, December 23 - 18:05

Printer-friendly version

NOTE: This page is based on the following master page:

http://www.joshuaburkholder.com/glut

Downloads:

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

~~~~TODO~~~~

http://sourceforge.net/projects/mingw/

2) Download and Unzip the GLUT for Win32 Source Code

~~~~TODO~~~~

http://www.xmission.com/~nate/glut.html

During the writing of this procedure, I used the source files located in the following zip file:
http://www.xmission.com/~nate/glut/glut-3.7.6-src.zip

3) Download the Makefile

~~~~TODO~~~~

Right click the following link and save the file:

http://www.joshuaburkholder.com/glut/makefile

Save the makefile to the root of the unzipped GLUT for Win32 folder (i.e. glut-3.7.6/ where the README is located).

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 _STDCALL_SUPPORTED
#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:

5) Make the GLUT for Win32

~~~~TODO~~~~

In MSYS (the MinGW Shell ... where /mingw is defined), cd to the root of the GLUT for Win32 folder (i.e. glut-3.7.6/ where the makefile was saved).

mingw32-make


This will make glut32.dll and libglut32.a.

6) Install the GLUT for Win32

~~~~TODO~~~~

mingw32-make install


This will install glut.h in /mingw/include/GL, glut32.dll in /mingw/bin, and libglut32.a in /mingw/lib.

7) Test the GLUT for Win32

~~~~TODO~~~~

mingw32-make test


This will build and run the asteroids program in progs/gameglut/. The following window will initially be produced:

asteroids.png

References:

UNDER CONSTRUCTION

Site Status

Site maintenance completed May 25th, 2012 at 12:38 UTC