Jump to content
  • Advertisement
Sign in to follow this  
andrewk3652

OpenGL Strange opengl errors MSVC 6.0 and .NET 2003

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

Attempting to compile anything on MSVC .NET 2003 or MSVC 6.0 that contains any gl headers throws no less than 100 errors. And the worst part is, three files including the same gl header may produce two or even three different errors on the same line. To wit: (VC 6.0 output, .NET is similar)
Compiling...

md2loader.cpp
c:\program files\microsoft visual studio\vc98\include\gl\gl.h(1152) : error C2146: syntax error : missing ';' before identifier 'glAccum'
c:\program files\microsoft visual studio\vc98\include\gl\gl.h(1152) : error C2182: 'APIENTRY' : illegal use of type 'void'
c:\program files\microsoft visual studio\vc98\include\gl\gl.h(1152) : fatal error C1004: unexpected end of file found

test.cpp
c:\program files\microsoft visual studio\vc98\include\gl\gl.h(1152) : error C2146: syntax error : missing ';' before identifier 'glAccum'
c:\program files\microsoft visual studio\vc98\include\gl\gl.h(1152) : error C2182: 'APIENTRY' : illegal use of type 'void'
c:\program files\microsoft visual studio\vc98\include\gl\gl.h(1152) : fatal error C1004: unexpected end of file found

texturedpoly.c
c:\program files\microsoft visual studio\vc98\include\gl\gl.h(1152) : error C2061: syntax error : identifier 'glAccum'
c:\program files\microsoft visual studio\vc98\include\gl\gl.h(1152) : error C2059: syntax error : ';'
c:\program files\microsoft visual studio\vc98\include\gl\gl.h(1152) : error C2059: syntax error : 'type'
c:\program files\microsoft visual studio\vc98\include\gl\gl.h(1153) : error C2054: expected '(' to follow 'WINGDIAPI'
Here's the offending line in gl.h and the few lines surrounding it:
/* For compatibility with OpenGL v1.0 */
#define GL_LOGIC_OP GL_INDEX_LOGIC_OP
#define GL_TEXTURE_COMPONENTS GL_TEXTURE_INTERNAL_FORMAT

/*************************************************************/

WINGDIAPI void APIENTRY glAccum (GLenum op, GLfloat value);
WINGDIAPI void APIENTRY glAlphaFunc (GLenum func, GLclampf ref);
WINGDIAPI GLboolean APIENTRY glAreTexturesResident (GLsizei n, const GLuint *textures, GLboolean *residences);
Anything that has WINGDIAPI in it creates problems. And as you can see the preceding lines are defines, so there's not a missing semicolon or something like that. VC doesn't even produce consistent errors. GCC at least is consistent when it fails. As you can see the first two find an unexpected EOF and the rest work just fine, with a host of other errors. What the hell is going on here?

Share this post


Link to post
Share on other sites
Advertisement
Try including windows.h before gl.h and/or glu.h

Those errors sound familair to me.:P
Well, atleast I had similar problems when I forgot that include.

If you are using SDL, you should include SDL_OpenGL.h instead of gl.h (and windows.h).

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!