linker error about glut in dev C++

[Linker error] undefined reference to glClear@4' [Linker error] undefined reference toglColor3f@12’

I had the code:

#include <cstdlib>
#include <iostream>
#include <GL/gl.h>
#include <GL/glu.h>
#include <GL/glut.h>
#include <windows.h>
#include <stdlib.h>
#include <stdio.h>
#include <vector>
//#include <libiberty.h>
using namespace std;

int main(int argc, char *argv[])
return 0;

I don’t know where is the problem

I have copied the glut.h to the …/GL/
glut32.dll and glut.dll to …/system32
glut32.lib and glut.lib to …/lib

Looks like a namespace issue with C++ code calling C, but I wouldn’t expect it with extern “C” {} blocks around those headers if it’s included.

The issue is gl.h, take a look and make sure it has extern “C” { at the top of teh file.

Hmm… it may be the way your glut has been compiled and your lib cant resolve the names when linking, I’d be somewhat surprised though.

Did you compile glut? Did you get it as a binary compiled by another development system?

I download the files from
and the file had been already compiled .
So I don’t know if it is compiled at other systems.

I had the same problem
On Dev C++ goto the project options menu and
add the switches -lopengl32 or so
as is explained in the first lines in readme.txt
on folder /include/gl/