Sign in to follow this  

windows.h before gl.h

This topic is 4203 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Is windows.h always supposed to be included before gl.h on the Windows platform? I ask because at least two libraries have failed to compile because they don't include windows.h before gl.h. I would expect these crossplatform libraries to do a check like #ifdef __WIN32__ #include <windows.h> #endif So it makes me suspect I am doing something wrong. It fails on this line in GL/gl.h:
WINGDIAPI void APIENTRY glAccum (GLenum op, GLfloat value);
So I had to add an #include <windows.h> and I suppose I should also do the mean and lean thing, right?

Share this post


Link to post
Share on other sites
Yeah you need to do windows.h before OpenGL headers. As for the lean and mean you can use it or not its up to you. It just removes a bunch of code that you probably won't use for games... I have it called and haven't had any errors or any reason to not use it.

It is used to exclude rarely-used services from Windows headers. Also if you are using MFC its automatically used.

Share this post


Link to post
Share on other sites
Yeah, I'll add lean and mean to be defined in my project settings.

So my question: Should I modify gl.h to include windows.h or should I modify each file that includes gl.h? Moreover, why isn't windows.h automatically included from gl.h?

Share this post


Link to post
Share on other sites

This topic is 4203 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this