#16 Windows user32.lib and gdi32.lib not linked via freeglut.h

nuisance (37)

The freeglut header file includes #pragma lines
to link the winmm, opengl32 and glu32 system

Two additional libraries are needed by freeglut
for linking: user32.lib and gdi32.lib

These are included as defaults in dev studio
projects, but should appear in freeglut.h
for the purpose of completeness. The GLUT
source distro included in Mesa includes both
user32 and gdi32 along with winmm, opengl32
and glu32.

The suggested lines in freeglut.h:
(near line 64)

#pragma comment (lib, "winmm.lib") /* link with
Windows MultiMedia lib */
#pragma comment (lib, "user32.lib") /* link with
Windows user lib */
#pragma comment (lib, "gdi32.lib") /* link with
Windows GDI lib */
#pragma comment (lib, "opengl32.lib") /* link with
Microsoft OpenGL lib */
#pragma comment (lib, "glu32.lib") /* link with
OpenGL Utility lib */


  • James 'J.C.' Jones

    • labels: 544422 --> nuisance
    • assigned_to: nobody --> puggles
    • status: open --> closed-accepted
  • James 'J.C.' Jones

    Logged In: YES

    I remember this stuff from Windows... yeah...

    Okay, your change is in.

    For note, the changed file was glut.h, not freeglut.h.


Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks