遇到许多OpenGL错误 [英] Getting many OpenGL Errors

查看:261
本文介绍了遇到许多OpenGL错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试编译其他人的项目,但我遇到了大约850个与OpenGL有关的错误.我在64位Windows 7上使用Visual Studio 2008,但是该项目是Win32项目.

I'm trying to compile someone else's project, and I'm getting about 850 errors all related to OpenGL. I'm using Visual Studio 2008, on 64-bit Windows 7, but the project is a Win32 project.

如您所见,下面的错误来自Windows SDK的gl.h包含文件夹,位于Program Files下,而不是Program Files (x86)下,因此我猜这是问题的一部分.我尝试添加具有gl.h且位于Program Files (x86)下的.NET 2003包含目录,但仍尝试使用Program Files下的gl.h版本.

As you can see, the errors below are from gl.h in the Windows SDK include folder under Program Files, not Program Files (x86) so I'm guessing that's part of the problem. I've tried adding the .NET 2003 include directory which has gl.h and is under Program Files (x86), but it's still trying to use the version of gl.h under Program Files.

此外,该项目使用wxWidgets 2.4.2,我找不到解决方案本身包含的gl.h的任何实例,因此我不确定是什么原因将其引入.

Also, the project uses wxWidgets 2.4.2 and I can't find any instance of gl.h being included in the solution itself, so I'm not sure what's pulling it in.

更新:仍然无法编译.我要编译的实际项目是"交互式数字图像蒙太奇"工具(链接中的源代码).它们包括一个VS2003项目文件和说明,我仔细地遵循了这些文件和说明.我什至尝试在VS2003中构建,并遇到相同的错误.我很好奇是否有人有时间在他们的系统上尝试一下,看看他们是否遇到相同的错误.需要安装wxWidgets 2.4.2.

Update: Still unable to compile this. The actual project I'm trying to compile is the "Interactive Digital Photomontage" tool (source code at the link). They include a VS2003 project file and instructions, which I followed carefully. I even tried building in VS2003 and got the same errors. I'm curious if anyone has a moment to try this on their system and see if they get the same errors. Requires wxWidgets 2.4.2 to be installed.

有什么想法吗?我在下面提供了一些错误的示例.谢谢.

Any thoughts? I've included a sample of some of the errors below. Thanks.

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

推荐答案

您需要包括"windows.h" 在"gl.h"之前

you need to include "windows.h" before "gl.h"

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

这篇关于遇到许多OpenGL错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆