Trying to include OpenGL

Started by
3 comments, last by X Abstract X 14 years, 1 month ago
I've been including SDL_OpenGL without problem but now I want to use GLee. I'm getting nearly 300 compiler errors in c:\program files\microsoft sdks\windows\v6.0a\include\gl\gl.h. I put the GLee lib and header in my visual studio include and lib folders and including in this order. #include "GLee.h" #include "GL/GL.h" #include "SDL.h" Hope someone can help. Thanks.
Advertisement
http://www.opengl.org/sdk/libs/GLee/

Quote:
Usage examples
To use GLee, include GLee.h from your code, then link to the GLee library (e.g. GLee.lib) or add GLee.c to your project.

To check for the ARB_multitexture extension and use it:
#include <gl\GLee.h> // (no need to link to gl.h)
...
if (GLEE_ARB_multitexture) //is multitexture support available?
{
glMultiTexCoord2fARB(...); //safe to use multitexture
}
else
{
//fallback
}


you dont need to include the header GL.h
----------------------www.westernwars.comwww.ebgaming.com
Yes, I read that earlier and even after removing the #include "GL/gl.h", I still get the errors referencing gl.h.
Hi. I went through this just the other day. I had to do the follwing;

1. Download the GLee package an unpack in a temporary folder.
2. Move the GLee.h file into the include\gl folder, and the GLee.lib into the lib folder of your Platform SDK and windows SDK installations. For me this was;
C:\Program Files\Microsoft Platform SDK\include | lib
C:\Program Files\Microsoft SDKs\Windows\v7.0a\include | lib
These will be different depending upon which SDK's you have installed and upon the IDE you are using and its configuration. Check the setting of your IDE and/or project to determine which are being used, or you could brute force this and use a file find/search and find all of the places gl.h exists :)

3. In your project you will need to add the GLee.lib along side opengl32.lib and glu.lib so the linker can resolve.

4. Finally, you have to have the right includes in your headers otherwise you still continue to get errors. I was down to one which said "gl.h was found before glee.h", which meant I had to search every header for gl.h includes and remove them. In my main program cpp file I put #include <gl\GLee.h> and following that #include <gl\glu.h>. That was all. As MatthewS said, no need to gl.h to be included. Occasionally a header required a <gl\GLee.h>. Depending upon how well structured your headers and cpp files are you might or might not be engaged in a little cleanup.

HTH
F541
Thanks, I got it working just before I read your post. It turns out I had to still link to the opengl 32 lib and include <windows.h>.

This topic is closed to new replies.

Advertisement