• Advertisement

Archived

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

error including the damn libraries wtf?

This topic is 5930 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

*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

Share this post


Link to post
Share on other sites
Advertisement
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)

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
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.

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites

  • Advertisement