2010-10-19 97 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標頭。