获得许多OpenGL错误

时间:2011-06-03 02:52:57

标签: visual-studio-2008 opengl

我正在尝试编译其他人的项目,并且我得到大约850个与OpenGL相关的错误。我在64位Windows 7上使用Visual Studio 2008,但该项目是一个Win32项目。

如您所见,以下错误来自gl.h下的Windows SDK包含文件夹中的Program Files,而不是Program Files (x86),因此我猜测这是问题的一部分。我已经尝试添加了包含gl.h并位于Program Files (x86)下的.NET 2003 include目录,但它仍在尝试使用Program Files下的gl.h版本。

此外,该项目使用wxWidgets 2.4.2,我找不到任何gl.h的实例包含在解决方案本身中,所以我不确定是什么在拉它。

更新:仍无法编译此内容。我正在尝试编译的实际项目是“Interactive Digital Photomontage”工具(链接的源代码)。它们包括一个VS2003项目文件和说明,我仔细遵循。我甚至尝试在VS2003中构建并获得相同的错误。我很好奇,如果有人有时间在他们的系统上尝试这个,看看他们是否得到相同的错误。需要安装wxWidgets 2.4.2。

有什么想法?我在下面列出了一些错误示例。谢谢。

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'
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(1153) : error C2144: syntax error : 'void' should be preceded by ';'
1>C:\Program Files\Microsoft SDKs\Windows\v6.0A\\include\GL/gl.h(1153) : 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(1153) : error C2086: 'int WINGDIAPI' : redefinition

1 个答案:

答案 0 :(得分:15)

你需要包含“windows.h” 在“gl.h”之前

#include "windows.h"
#include "gl.h"