Devcpp & opengl?

Can anybody mention only ONE compiler that compiles ALL openGL programs? For example, I tried to compile one with MingW, and I got a lot of errors:

[Linker error] undefined reference to gluPerspective@32' [Linker error] undefined reference togluNewQuadric@0’
[Linker error] undefined reference to gluCylinder@36' [Linker error] undefined reference togluSphere@20’
[Linker error] undefined reference to `gluDeleteQuadric@4’
And so on…
Also when I find an example that was made not with the compiler I use, how can I make it run???
Or did I forget to include some libraries in the project info?

Viktor Erdelyi

Hi !

As the error message says, it is not a compiler error but a linker error, and in your case it is an error indicating that you have not included the correct libraries to the linker options, these are the -lgl -lglu and so on, not sure how you do that with devcpp though, it is also important that you put the libraries in the correct order, usage before implementation.

In your case you have not included the glu library (-lglu).


look at the mingw site they offer a great deal of help and if I do remember correctly one is a able to choose an opengl project from the wizard

give a look, it will help you get started

glut library is not included in minGW. You have to download a freeware or opensource version of it and link it.
Look here:
GLUT by Mike Robbins (win 3 porting)
or here:
I’m currently trying and installing it, too. I’m using DEV-C++ I’ll post the results of my experiments. Bye!

P.S. Try this also: it looks fine for Dev-C++ users.

Thanks. But I still have one question:
Many of the examples I found on the net are using functions like “aux…()”. I think it needs another library because I get some errors in the case of these examples. If anybody knows where I can find it, please let me know.

Viktor Erdelyi

I guess that is the auxiliary library try to look for glaux or something similar

Ok, I’ll have a look. And about the Glut… I found something called “glut for win32”. And it looks like a quite official release. Will it work with devcpp or should I try that “devpak”?

Eh…that OpenGlut.devpak or sg similar…is it just me or Windows really doesn’t know that file format?

I use Dev-C++ and OpenGL and it works just fine.

You do need to download the opengl files though.
You don’t really need the devpack. You just need to know where to stick the files in the Dev-C++ directory.
As for the file extension .devpack, I don’t think it’s Windows trying to recognize the filetype. Only dev-c++ needs to recognize it so it can use the file.

To link files to your project, you must first make a blank project.
Add your source code files to the project.
This allows you to go into the toolbar at the top where it says Project. Then click Project Options at the bottom of the pop-up menu (you can also just hit alt + p)
A window will appear and it will ask for linker options at the bottom of this new window. There you can link the files by:
-lopengl32 -lglu32 -lglaux -lglut32

Hope all this helps out.


Thats ok but where can I find that GLAUX library???

Totally new to OpenGL and GLUT. Want to develop game programs. Good at C++ now and some windows. What is a good place to start learning OpenGL and GLUT? I use MS C++ 6.0 compiler.