How to use Mark J. Kilgard's OpenGL Utility Toolkit (GLUT) with MinGW

When distributing any applications you built using GLUT, you need include a copy of glut32.dll in your distribution. This is not a standard Windows DLL so you can't expect your users to already have it installed on their systems. You should install glut32.dll in same directory as your application's executable. This ensures that other applications won't install a buggy or incompatible version of the GLUT DLL over yours.


Errors you may get:

E:\TEMP/ccwosggb.o:t10.c:(.text+0x1c): undefined reference to `__glutInitWithExit'
E:\TEMP/ccwosggb.o:t10.c:(.text+0x37): undefined reference to `__glutCreateWindowWithExit'
E:\TEMP/ccwosggb.o:t10.c:(.text+0x52): undefined reference to `__glutCreateMenuWithExit'
E:\TEMP/ccwosggb.o:t10.c:(.text+0x15a): undefined reference to `glutDisplayFunc'
E:\TEMP/ccwosggb.o:t10.c:(.text+0x15f): undefined reference to `glutMainLoop'
...

This indicates that you didn't define _STDCALL_SUPPORTED before including <GL/glut.h>. See the instructions above on different ways you can do this.


E:\TEMP/ccMMoggb.o(.text+0x1c):t10.c: undefined reference to `__glutInitWithExit@12'
E:\TEMP/ccMMoggb.o(.text+0x3e):t10.c: undefined reference to `__glutCreateWindowWithExit@8'
E:\TEMP/ccMMoggb.o(.text+0x60):t10.c: undefined reference to `__glutCreateMenuWithExit@8'
E:\TEMP/ccMMoggb.o(.text+0x1a5):t10.c: undefined reference to `glutDisplayFunc@4'
E:\TEMP/ccMMoggb.o(.text+0x1ad):t10.c: undefined reference to `glutMainLoop@0'
...

This indicates you're using an older version of binutils. Upgrade to 2.16.91.


E:\TEMP/ccMMoggb.o(.text+0x1c):t10.c: undefined reference to `__glutInitWithExit@12'
E:\TEMP/ccMMoggb.o(.text+0x3e):t10.c: undefined reference to `__glutCreateWindowWithExit@8'
E:\TEMP/ccMMoggb.o(.text+0x60):t10.c: undefined reference to `__glutCreateMenuWithExit@8'

If these are the only three undefined references then you probably linked with -lglut32 instead of glut32.lib.


./GL/glut.h:58: warning: ignoring #pragma comment
./GL/glut.h:66: warning: ignoring #pragma comment
./GL/glut.h:67: warning: ignoring #pragma comment
./GL/glut.h:68: warning: ignoring #pragma comment
./GL/glut.h:76: warning: ignoring #pragma warning
./GL/glut.h:77: warning: ignoring #pragma warning

These warnings are harmless, but you can define the macros GLUT_NO_LIB_PRAGMA and GLUT_NO_WARNING_DISABLE before including <GL/glut.h> to prevent them.


./GL/glut.h:549: warning: 'glutCreateMenu_ATEXIT_HACK' defined but not used

This warning is also harmless, but I'm not sure of any safe way to prevent it without modifying <GL/glut.h>.

PHP Warning

lib/XmlElement.php:43 Warning[2]: get_class() expects parameter 1 to be object, string given (...repeated 9 times)

lib/XmlElement.php (In template 'navbar' < 'top' < 'body' < 'html'):43 Warning[2]: get_class() expects parameter 1 to be object, string given:

lib/XmlElement.php (In template 'navbar' < 'top' < 'body' < 'html'):43 Warning[2]: get_class() expects parameter 1 to be object, string given:

lib/XmlElement.php (In template 'browse' < 'body' < 'html'):43 Warning[2]: get_class() expects parameter 1 to be object, string given

Valid XHTML 1.0! Valid CSS!
Page Execution took real: 0.086, user: 0.040, sys: 0.010 seconds , Memory: 2475712

lib/XmlElement.php (In template 'actionbar' < 'browse-footer'):43 Warning[2]: get_class() expects parameter 1 to be object, string given:

lib/XmlElement.php (In template 'actionbar' < 'browse-footer'):43 Warning[2]: get_class() expects parameter 1 to be object, string given: