• Create Account

## error including the damn libraries wtf?

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

7 replies to this topic

### #1wing_majin  Members

Posted 24 October 2001 - 06:57 PM

*anger* I can't begin to say how much long i've dealt with this.... I'm trying to make some standard classes for my own use in GL. I write all my classes fine etc etc, nothing complicated as such to induce any errors. However as soon as I include JUST like the pros do in their source (ex NeHe etc) I get a wondeful trio of compiling errors telling me basically that things are either getting redefined or who knows etc etc. This occurs as soon as I include it AND when there's a file in it I downloaded as a tutorial or something that has the EXACT same thing "#include " as my own class..... c:\program files\include\gl\gl.h(1152) : error C2144: syntax error : missing ';' before type 'void' c:\program files\include\gl\gl.h(1152) : error C2501: 'WINGDIAPI' : missing storage-class or type specifiers c:\program files\include\gl\gl.h(1152) : fatal error C1004: unexpected end of file found (and those errors all occur, supposadly, IN gl/gl.h ) Is there something up with my project settings? Edited by - wing_majin on October 25, 2001 2:02:41 AM

### #2Maximus  Members

Posted 24 October 2001 - 07:03 PM

Those errors arent from including the libraries, rather the header files.

Make sure all the lines BEFORE you #include gl/gl.h are correct (ie not missing semi-colons, etc)

### #3wing_majin  Members

Posted 24 October 2001 - 07:06 PM

Yeah I''m aware that it''s the file, and although it seems like those are common "human screw up" errors...
#include is the absolute first line in the file
so i figured it might have somethign to do with my settings somwhere im not sure

### #4baumep  Members

Posted 24 October 2001 - 07:53 PM

If the #include ... is in the first line of your header files, maybe that's the cause for the errors. If your #includes are in a header file you wrote yourself, make sure you have an #ifndef ... #define ... #endif construct in your own header files.

Example:
// myheader.h#ifndef _MYHEADER_H_#define _MYHEADER_H_#include <gl/gl.h>#include <gl/glu.h>... declarations ...#endif // #ifndef _MYHEADER_H_// end of myheader.h

baumep

Edited by - baumep on October 25, 2001 2:54:53 AM

### #5wing_majin  Members

Posted 24 October 2001 - 08:52 PM

Thanks, but yeah, I know how to write and define classes and all that and im fairly aware of the whole linking process. However, I DO have all that there, but I require the GL in my implementation file "header.cpp", when I include that with a nicely defined class...it gives problems

### #6siaspete  Members

Posted 24 October 2001 - 09:01 PM

You need to include windows.h before gl.h

- Pete

### #7Anonymous Poster_Anonymous Poster_*  Guests

Posted 24 October 2001 - 09:50 PM

What happens is that WINGDIAPI class is undefined, so the when the complier sees
WINGDIAPI void APIENTRY glAccum (GLenum op, GLfloat value);
- the first function prototype in the header file, it doesn''t know what WINGDIAPI is, so you get the error '';'' missing before type ''void''

All you have to do is what siaspete said #include before #include and you''ll be fine.

### #8wing_majin  Members

Posted 25 October 2001 - 06:17 AM

Thanks that did it. I figured it had something to do with definition here or there but I didn''t think it was that simple to fix

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.