Hey how's it goin' every body,
I am pretty new to opengl so please bear with me a little k. Here goes... I downloaded glut.dll,glut.lib and glut.h. Placed them in the following directories: glut32.dll to windows system32 directory, glut32.lib to dev-cpp lib directory, and glut.h to dev-cpp gl directory. Yet when I compile a simple opengl win32 "draw quad" program I get Link errors.
So I checked to see if I added the link to the project - project options/ parameter then added the line "-lglut32" but without the quotes. I even added the line #pragma comment(lib,"glut32.lib") to be safe. I'm using Windows Vista with DEV-CPP.
These are the three errors that pops up after compiling:

  [Linker error] undefined reference to '__glutInitWithExit@12'
  [Linker error] undefined reference to '__glutCreateWindowWithExit@8' 
  [Linker error] undefined reference to '__glutCreateMenuWithExit@8' 

The line of code that uses it is in my "InitGL" function.

#pragma comment(lib,"opengl32.lib")
#pragma comment(lib,"glut32.lib")

#include <windowsx.h>
#include <windows.h>
#include <gl/gl.h>
#include <gl/glu.h>
#include <gl/glut.h>
#include <ctype.h>

//globals goes here
int  *g_pi;
char  g_char;

bool InitGL()
{//all opengl inits goes here

   return TRUE;

And the only place I use glut is in my rendering function "SceneRendering" namely "glSolidCube". I've looked every where for a solution and found a few installation manual but it didn't solve my linking situation. I was hoping that someone could confirm that I correctly installed glut and properly set it up into my project. Much oblique to you all for your help.

Edited by mike_2000_17: Fixed formatting

6 Years
Discussion Span
Last Post by sadaka

Well this is not the first time on this forum that people have posted weird problems while using Windows Vista / 7 and Dev-C++ (a combination that has many known issues). I recommend you try another IDE, like Code::Blocks and see if the problem persists.


thanks for your help but i've tried as you recommended and it still shows me the same error so i've decided to just manually create a grapics rendering function purely out of c/c++ until i can get a clearer understanding of opengl from the red or blue book. again thank you for your time and help. peace

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.