PDA

View Full Version : MSVC++ not finding headers



Distortion
12-23-2003, 03:46 PM
The posts i've seen on the header files say that MS visual C++ includes all the needed files from the OpenGL file library already, but when I try to compile, it's not finding them. I'm going to keep looking, but in case I can't find them, does anyone know where I can get them?

12-23-2003, 03:51 PM
http://oss.sgi.com/projects/ogl-sample/registry/

As said more than 1000 times this month on this very board.

Distortion
12-23-2003, 03:58 PM
yeah, sorry, i kind of figured it was a common problem, but wasn't able to find any posts on it.

nexusone
12-24-2003, 04:52 AM
Did you really look in this forum?

To answer your questions, the base openGL headers are shipped with VC++: gl.h, glu.h and glaux.h(windows only library), But does not include extra openGL support library's like GLUT, which must be downloaded extra.

1. Did you include the correct path for the headers? Should be in the directory :/include/gl/" inside the VC program directory.

2. Note that Microsoft only ship's the openGL 1.1 headers, because of the lack of support of openGL over Direct-x. To access commands past 1.1, you need to use extensions.(hundereds of post on the subject here.)

3. Another common problem is people not reading on how to use the compiler and not adding the openGL library's in the linking process. Which will give an error of not seeing the openGL commands.


Originally posted by Distortion:
yeah, sorry, i kind of figured it was a common problem, but wasn't able to find any posts on it.

[This message has been edited by nexusone (edited 12-24-2003).]

[This message has been edited by nexusone (edited 12-24-2003).]

Distortion
12-24-2003, 09:54 PM
yeah, they were already there, i had just somehow messed something up...i figured it out yesterday, i don't remember what i changed, but it finds them now.

Viper00
12-26-2003, 12:32 AM
Originally posted by Distortion:
The posts i've seen on the header files say that MS visual C++ includes all the needed files from the OpenGL file library already, but when I try to compile, it's not finding them. I'm going to keep looking, but in case I can't find them, does anyone know where I can get them?

include should be as here (remember that some systems are case sensitive in files names):

#include <GL/GL.H>
#include <GL/GLU.H>
#include <GL/GLAUX.H>

and .lib files should be added to project as follow:

#pragma comment ( lib , "opengl32.lib" )
#pragma comment ( lib , "glu32.lib" )
#pragma comment ( lib , "glaux.lib" )

it works in my projects so I think that it'll works in your. If that doesn't work just try to reinstall MSVC++ :p

LaughingOtter
01-03-2004, 09:29 AM
Ah! That's got it!
You know, none of the books on OpenGL mention adding the pragma comment parts to the VC++ source. At least, none of mine do.