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

Started by
2 comments, last by silverphyre673 17 years, 10 months ago
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!
my siteGenius is 1% inspiration and 99% perspiration
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>
deathkrushPS3/Xbox360 Graphics Programmer, Mass Media.Completed Projects: Stuntman Ignition (PS3), Saints Row 2 (PS3), Darksiders(PS3, 360)
I'm almost positive that <SDL/SDL_opengl.h> includes gl.h
daerid@gmail.com
You people are amazing, wonderful human beings. Thanks so much!
my siteGenius is 1% inspiration and 99% perspiration

This topic is closed to new replies.

Advertisement