openGL on dev C++

i have been using dev c++ for making simple little console programs and now i want to try openGL.

I went and downloaded the openGl libraries and the glaux libraies and i tried to compile the devc++ tutorials at and when i tried to compile them i got lots of error messages.

has anybody here ever set up openGl using devC++ and if so could you please explain how you set it up.
i am using winXP by the way and i have a “ATI all in wonder 9200 pro” if that helps and i have dev c++ set up in my c:\ directorie, so its like c:\dev-cpp\include\GL.

s.b. straightforward. The only wrinkle I can think of would be the order that your Dev. Studio searches header files.

Go to Tools->Options->Directories. Pull down (from the right hand side) Include Files and Library Files. Make sure the SDK is ahead of VC directories for each.

Hope that helps.

ok i think i might have finally set up my devc++ compiler to run openGL files and i am using a openGL tutorial from the website and its says to include the following headers:

#include <stdio.h>
#include <stdlib.h>
#include <gl/gl.h>
#include <gl/glu.h>
#include <gl/glut.h>

amd these are the only error messages i get and they have nothing to do with header files so what do the following error messages mean:

[Linker error] undefined reference to `__glutInitWithExit@12’

[Linker error] undefined reference to `__glutCreateWindowWithExit@8’

[Linker error] undefined reference to `__glutCreateMenuWithExit@8’

i am using dev-cpp under windows xp and the nehe-tutorials. I used the libraries and headers delivered with dev-cpp 5 beta. I had to replace a library file: liblaux.a by one I downloaded from the net: glaux.lib. I copied glaux.lib into the dev-cpp/lib directory and renamed it to libglaux.a. After that I experienced no further problems.
I linked the project with libglaux.a, libglu32.a etc. (look in the nehe tutorials)I hope this helps

i downloaded openGl95.exe and when i clicked it and couple of headers and .LIB files came out, i renamed the file GLAUX.LIB to libgluax.a and put that and the other lib files that i did not already have in my lib directorie and the headers i did not have in my /lib/GL header includes.

i then included the following files:


in project setting and when i tried to compile i had the following error messages.

[Linker error] undefined reference to `ChoosePixelFormat@8’

[Linker error] undefined reference to `SetPixelFormat@12’

[Linker error] undefined reference to `SwapBuffers@4’

[Build Error] [Project1.exe] Error 1

so now what should i do.

These glut errors above means you need the # define GLUT_AT_EXIT_HACK (or whatever it is called, check the glut.h).

I do not think you need this glut-things. Do not include the glut headers or librarys. Just include
#include <windows.h>
#include <gl\gl.h> #include <gl\glu.h> #include <gl\glaux.h>

and link your project with OpenGL32.lib GLu32.lib and GLaux.lib (replaced one) or whatever they are called in dev-cpp/lib (i guess libopengl32.a, libglu32.a and libglaux.a

where do i enter #define_glut_at_exit in my source, also i downloaded the minGW development kit and so far it feels a lot better than dev-cpp and feels a loy more like visual c++.

has anybody ever set up openGL on this software, also how do you link in this software, in devc++ all you do is add library files but in minGW i go to project>>settings>>linker and all i can do is type so what do i do.

Hi Guys

I am begining to use Visual C (ver 6) and opengl.
Pls advice what i need to do in order to get them working…

For all newbe quastions…


Well, guess what… I’m in the same boat, just started on the NeHe tutorials… I’ve gotten them to work, though. Rght click on the project icon in the sidebar, go to Project Options, and chuck this in the “Further object files…” spot:

-lopengl32 -lglaux -lglu32

And check Compile C++ Project, and Do not create a console.

Now, in around… tutorial 6, I think, it started erroring when I compiled then executed… Try running it from the actual folder… This took me about an hour of trying to figure out the problem… then I stumbled upon the answer…

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.