• ### Popular Now

• 12
• 27
• 9
• 20
• 33

#### Archived

This topic is now archived and is closed to further replies.

# Include problems

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

## Recommended Posts

I''m sorry if this has been explained in some erlier post, I''d use search to find out but it''s temporarly disabled (anyone knows when it''ll be back?) so i can''t. I''m having problems with including standard headers like the gl.h For example I got this class, CSprite, in CSprite.h that needs the gl.h file, then I got the class CObject, that needs to include CSprite.h and use the gl.h and then finaly CObject.h needs to be included in main.h that also needs the gl.h. When I try to include gl.h in all needed files I often get compiler errors that complain of errors inside the gl.h file. Obvius this is casue I have include it wrong somewhere, casue if I only include it in one file things work fine (except of course that I can''t use the other two classes). What is the correct way to include gl.h?

##### Share on other sites
What are the errors you are referring to? Are you linking the proper libraries?

|.dev-c++.|.the gimp.|.seti@home.|.try2hack.|.torn.|

##### Share on other sites
Microsoft''s gl.h requires that windows.h be included before it. Do something like this:
#ifdef _WIN32  #include <windows.h>#endif#include <GL/gl.h>