A perplexing error(Me/vs 2005/and a header file)

Started by
2 comments, last by SiCrane 15 years, 11 months ago
I was looking at other apis thanks to the last post and answers and decided to use some code from some free tutorials to try out. I used the opengl free book from opengl.org and used some of the code. I ran into an odd error though. When I would type in the header files #include <GL/glu.h> #include <GL/glut.h> #include <stdlib.h> #include <GL/gl.h> and debugged it gave me something I haven't seen before. It started throwing 100's of error messages at the gl.h file instead of the main project. Even removing the #include directory for it wouldn't stop it from debugging this file. Another time it gave error messages for the stdlib.h directory. What should I do? last time this happened when it only debugged a .h file it some how later stopped and allowed the program to continue. Thanks
Advertisement
Assuming you mean that you were getting compiler errors, try putting #include <windows.h> before the OpenGL headers.
Thanks that did the trick, Just wondering why though?
The GL headers use things like function calling convention identifiers that are defined in windows.h, but don't actually include windows.h themselves. So in order for them to compile correctly, you need to include windows.h first. Don't ask me why the GL headers don't include windows.h, because I don't know.

This topic is closed to new replies.

Advertisement