2010-10-19 70 views
0

我正在使用Visual C++ 2008 Express Eition在Windows XP上工作。 我试着去包括:openGl - 从包括的错误

#include <GL/gl.h> 
#include <GL/glu.h> 
#include <GL/glut.h> 

,并得到错误的很多,如:

1>c:\program files\microsoft sdks\windows\v6.0a\include\gl\gl.h(1152) : error C2144: syntax error : 'void' should be preceded by ';' 
1>c:\program files\microsoft sdks\windows\v6.0a\include\gl\gl.h(1152) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int 
1>c:\program files\microsoft sdks\windows\v6.0a\include\gl\gl.h(1152) : error C2146: syntax error : missing ';' before identifier 'glAccum' 
1>c:\program files\microsoft sdks\windows\v6.0a\include\gl\gl.h(1152) : error C2182: 'APIENTRY' : illegal use of type 'void' 

我的问题是:我可以使用那些包含或者我需要得到这些库从某处开始? 谢谢。

回答

3

由于众所周知的原因,微软仅提供了各种Windows软件开发工具包OpenGL的头需要你

#include <windows.h> 

之前。

0

您可能试图将其编译为C++而不是C,或者沿着这些行编译。

0

你为什么在VC++ 2K8上使用名为'v6.0a'的SDK?你确定这是最新的OpenGL头?尽可能您应该使用最新的Platform SDK和OpenGL标头。