包含gl.h导致的问题

编译报错如下:

error C2144: syntax error : 'void' should be preceded by ';'
Error   C2144   syntax error: 'void' should be preceded by ';'  OpenGLTutorial  c:\program files (x86)\windows kits\8.1\include\um\gl\gl.h  1157
Error   C4430   missing type specifier - int assumed. Note: C++ does not support default-int    OpenGLTutorial  c:\program files (x86)\windows kits\8.1\include\um\gl\gl.h  1157
Error   C2182   'APIENTRY': illegal use of type 'void'  OpenGLTutorial  c:\program files (x86)\windows kits\8.1\include\um\gl\gl.h  1157
Error   C2146   syntax error: missing ';' before identifier 'glAccum'   OpenGLTutorial  c:\program files (x86)\windows kits\8.1\include\um\gl\gl.h  1157
Error   C2144   syntax error: 'void' should be preceded by ';'  OpenGLTutorial  c:\program files (x86)\windows kits\8.1\include\um\gl\gl.h  1157
Error   C4430   missing type specifier - int assumed. Note: C++ does not support default-int    OpenGLTutorial  c:\program files (x86)\windows kits\8.1\include\um\gl\gl.h  1157
Error   C2182   'APIENTRY': illegal use of type 'void'  OpenGLTutorial  c:\program files (x86)\windows kits\8.1\include\um\gl\gl.h  1157
Error   C2146   syntax error: missing ';' before identifier 'glAccum'   OpenGLTutorial  c:\program files (x86)\windows kits\8.1\include\um\gl\gl.h  1157

解决方法:
包含windows.h 如:

#ifdef _WIN32
#include 
#endif

#include 
#include 

你可能感兴趣的:(包含gl.h导致的问题)