• Advertisement
Sign in to follow this  

Getting tons of errors when including gl.h using MS PSDK in VC 2005 Express

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

I installed the MS PSDK for use with my IDE, MS VC 2005 Express. I want to use OpenGL with my project; this is the first time I have used the API with this IDE (I am still feeling my way around VC). Unfortunately, when I try to include <gl.h> (doing nothing with the actual API - just including the one header), 143 compiler errors occur, along these lines:
1>c:\msvc++\mspsdk\include\gl\gl.h(1152) : error C2144: syntax error : 'void' should be preceded by ';'
1>c:\msvc++\mspsdk\include\gl\gl.h(1152) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\msvc++\mspsdk\include\gl\gl.h(1152) : error C2146: syntax error : missing ';' before identifier 'glAccum'
1>c:\msvc++\mspsdk\include\gl\gl.h(1152) : error C2182: 'APIENTRY' : illegal use of type 'void'
1>c:\msvc++\mspsdk\include\gl\gl.h(1152) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\msvc++\mspsdk\include\gl\gl.h(1153) : error C2144: syntax error : 'void' should be preceded by ';'
1>c:\msvc++\mspsdk\include\gl\gl.h(1153) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\msvc++\mspsdk\include\gl\gl.h(1153) : error C2086: 'int WINGDIAPI' : redefinition
1>        c:\msvc++\mspsdk\include\gl\gl.h(1152) : see declaration of 'WINGDIAPI'
1>c:\msvc++\mspsdk\include\gl\gl.h(1153) : error C2146: syntax error : missing ';' before identifier 'glAlphaFunc'
1>c:\msvc++\mspsdk\include\gl\gl.h(1153) : error C2182: 'APIENTRY' : illegal use of type 'void'
1>c:\msvc++\mspsdk\include\gl\gl.h(1153) : error C2086: 'int APIENTRY' : redefinition
1>        c:\msvc++\mspsdk\include\gl\gl.h(1152) : see declaration of 'APIENTRY'
1>c:\msvc++\mspsdk\include\gl\gl.h(1153) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\msvc++\mspsdk\include\gl\gl.h(1154) : error C2146: syntax error : missing ';' before identifier 'GLboolean'
1>c:\msvc++\mspsdk\include\gl\gl.h(1154) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\msvc++\mspsdk\include\gl\gl.h(1154) : error C2086: 'int WINGDIAPI' : redefinition
1>        c:\msvc++\mspsdk\include\gl\gl.h(1152) : see declaration of 'WINGDIAPI'
1>c:\msvc++\mspsdk\include\gl\gl.h(1154) : error C2146: syntax error : missing ';' before identifier 'glAreTexturesResident'
1>c:\msvc++\mspsdk\include\gl\gl.h(1154) : error C2371: 'APIENTRY' : redefinition; different basic types
1>        c:\msvc++\mspsdk\include\gl\gl.h(1152) : see declaration of 'APIENTRY'
1>c:\msvc++\mspsdk\include\gl\gl.h(1154) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\msvc++\mspsdk\include\gl\gl.h(1155) : error C2144: syntax error : 'void' should be preceded by ';'
1>c:\msvc++\mspsdk\include\gl\gl.h(1155) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\msvc++\mspsdk\include\gl\gl.h(1155) : error C2086: 'int WINGDIAPI' : redefinition
1>        c:\msvc++\mspsdk\include\gl\gl.h(1152) : see declaration of 'WINGDIAPI'
1>c:\msvc++\mspsdk\include\gl\gl.h(1155) : error C2146: syntax error : missing ';' before identifier 'glArrayElement'
1>c:\msvc++\mspsdk\include\gl\gl.h(1155) : error C2182: 'APIENTRY' : illegal use of type 'void'
1>c:\msvc++\mspsdk\include\gl\gl.h(1155) : error C2086: 'int APIENTRY' : redefinition
1>        c:\msvc++\mspsdk\include\gl\gl.h(1152) : see declaration of 'APIENTRY'
1>c:\msvc++\mspsdk\include\gl\gl.h(1155) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\msvc++\mspsdk\include\gl\gl.h(1156) : error C2144: syntax error : 'void' should be preceded by ';'
1>c:\msvc++\mspsdk\include\gl\gl.h(1156) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\msvc++\mspsdk\include\gl\gl.h(1156) : error C2086: 'int WINGDIAPI' : redefinition
1>        c:\msvc++\mspsdk\include\gl\gl.h(1152) : see declaration of 'WINGDIAPI'
1>c:\msvc++\mspsdk\include\gl\gl.h(1156) : error C2146: syntax error : missing ';' before identifier 'glBegin'
1>c:\msvc++\mspsdk\include\gl\gl.h(1156) : error C2182: 'APIENTRY' : illegal use of type 'void'
1>c:\msvc++\mspsdk\include\gl\gl.h(1156) : error C2086: 'int APIENTRY' : redefinition
1>        c:\msvc++\mspsdk\include\gl\gl.h(1152) : see declaration of 'APIENTRY'
1>c:\msvc++\mspsdk\include\gl\gl.h(1156) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\msvc++\mspsdk\include\gl\gl.h(1157) : error C2144: syntax error : 'void' should be preceded by ';'
1>c:\msvc++\mspsdk\include\gl\gl.h(1157) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\msvc++\mspsdk\include\gl\gl.h(1157) : error C2086: 'int WINGDIAPI' : redefinition
1>        c:\msvc++\mspsdk\include\gl\gl.h(1152) : see declaration of 'WINGDIAPI'
1>c:\msvc++\mspsdk\include\gl\gl.h(1157) : error C2146: syntax error : missing ';' before identifier 'glBindTexture'
1>c:\msvc++\mspsdk\include\gl\gl.h(1157) : error C2182: 'APIENTRY' : illegal use of type 'void'
1>c:\msvc++\mspsdk\include\gl\gl.h(1157) : error C2086: 'int APIENTRY' : redefinition
1>        c:\msvc++\mspsdk\include\gl\gl.h(1152) : see declaration of 'APIENTRY'

I am most confused by these errors. I have just been using SDL for most things OS-related until now with this IDE; I had to install the PSDK to use SDL, and it has worked just fine up until now. In addition, using the SDL OpenGL-related commands works just fine. Including <windows.h> generates no errors, either. If you need more information, just let me know. I am most confused by this. Thanks for any help you can give!

Share this post


Link to post
Share on other sites
Advertisement
Include windows.h and gl.h in this order:

#include <windows.h>
#include <GL/gl.h>

EDIT: If you are using SDL with OpenGL, then include these headers:
#include <SDL.h>
#include <SDL_OpenGL.h>
#include <GL/gl.h>

Share this post


Link to post
Share on other sites
I'm almost positive that <SDL/SDL_opengl.h> includes gl.h

Share this post


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

  • Advertisement