2011-03-09 160 views
1

我得到一堆錯誤如下: -刪除包含錯誤

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

這是一切,我包括我的代碼開頭: -

#include <cstdlib> 
#include <windows.h> 
#include <GL/glut.h> 
#include <cmath> 
#include "arcball.h" 
#include <vector> 
#include <iostream> 
#include <fstream> 


using namespace std; 

這是雖然很有趣當我點擊第一個錯誤指向我行

WINGDIAPI void APIENTRY glAccum (GLenum op, GLfloat value); 
在gl.h

。我甚至不包括file.Where是錯誤來自哪裏?

PS。不知道它是否重要,但我已將該文件保存爲.cpp文件。

好吧,這很奇怪,但我完全刪除所有的標題,它仍然顯示我這個錯誤!

+0

glut.h不再與該SDK包含的分佈。你從哪裏得到它的?提供一個URL。 – 2011-03-09 02:18:20

+0

好吧,我把它從這裏的示例項目.https://agora.cs.illinois.edu/display/cs418sp11/Home在討論頁面的底部。解壓縮後,將glut.h複製並放到我的項目。 – Manish 2011-03-09 02:29:33

回答

0

您可能會錯過包含文件WinGDI.hgl.h很可能是由文件<GL/glut.h>

#include <cstdlib> 
#include <windows.h> 
#include <WinGDI.h> // <-------------------- 
#include <GL/glut.h> 
#include <cmath> 
#include "arcball.h" 
#include <vector> 
#include <iostream> 
#include <fstream> 
+0

Nope does not work ...我添加了你說的那一行..它可能與項目屬性有關嗎? – Manish 2011-03-09 02:01:47