Jump to content

  • Log In with Google      Sign In   
  • Create Account


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


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.

  • You cannot reply to this topic
3 replies to this topic

#1 silverphyre673   Members   -  Reputation: 454

Like
0Likes
Like

Posted 12 July 2006 - 07:27 PM

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!

Sponsor:

#2 deathkrush   Members   -  Reputation: 350

Like
0Likes
Like

Posted 12 July 2006 - 07:28 PM

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>

#3 daerid   Members   -  Reputation: 354

Like
0Likes
Like

Posted 12 July 2006 - 08:55 PM

I'm almost positive that <SDL/SDL_opengl.h> includes gl.h

#4 silverphyre673   Members   -  Reputation: 454

Like
0Likes
Like

Posted 13 July 2006 - 05:17 AM

You people are amazing, wonderful human beings. Thanks so much!




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.



PARTNERS