关于 X11 头文件的 OpenGL Glew 错误
好吧,我对 OpenGL 还算陌生,但我想我应该学习使用 OpenGL,因为它目前从一开始就应该使用。因此,我将跳过所有使用 glew 访问 OpenGL 3.x 的固定管道内容,并按照在线教程进行操作。
在线教程只提到我必须先安装 glew 本身才能开始,因为我有一张显卡,其驱动程序附带 OpenGL 4.0。所以我已经准备好了,我已经下载了 win32 版本的 glew 二进制文件,安装了它,在 VC++ 2010 中创建了一个项目,设置了所有路径,并按照教程制作了一个快速的 OpenGLContext 类来创建渲染上下文,并将其放入女士窗口(无过剩)。问题是当我构建这个类时,我在 glew 头文件之一中收到错误。
它涉及一系列涉及 X11 的标头包含。该教程似乎暗示我不应该去查找并下载并设置X11的路径信息,所以我不知道我做错了什么。有什么帮助、建议等吗?
这是具体错误:“1>c:\glew\glew-1.5.8\include\gl\glxew.h(97): fatal error C1083: Cannot open include file: 'X11/Xlib.h': No such文件或目录”
与该错误有关的唯一来源是错误中所述文件顶部的一系列包含语句。
下载的glew库可以在这里找到: https://sourceforge.net/projects/glew/files/glew/1.5.8/glew-1.5.8-win32.zip/download
我不知道这是否重要,但这是我引用的方式我的源更新中的 OpenGL 和 glew
#pragma once
#include <gl/glew.h>
#include <gl/wglew.h>
#include <gl/GL.h>
#pragma comment(lib, "glew32.lib")
#pragma comment(lib, "opengl32.lib")
:通过删除 gl/GL.h 包含修复了此错误...是的,我也不知道...无论如何,整个项目都表现得很有趣...
Okay so I'm kind of new with OpenGL, but I thought I should learn to use OpenGL as it's currently meant to be used from the word go. So I'm skipping all the fixed pipeline stuff using glew to access OpenGL 3.x and following a tutorial online.
The tutorial online only mentions I will have to install glew itself to begin, as I have a graphics card whose drivers come with OpenGL 4.0. So I'm all set, I've downloaded the win32 version of the glew binaries, installed it, made a project in VC++ 2010 set all the paths, and followed the tutorial and have made a quick OpenGLContext class that makes a render context, and puts it into a Ms Window (without glut). The problem is when I build this class I get an error inside one of the glew header files.
It's concerning a series of header includes involving X11. The tutorial seems to imply that I shouldn't have to go find and download and set up path information for X11, so I don't know what I did wrong. Any help, suggestions, etc?
Here is the specific error: "1>c:\glew\glew-1.5.8\include\gl\glxew.h(97): fatal error C1083: Cannot open include file: 'X11/Xlib.h': No such file or directory"
The only source concerned with the error are a series of include statements at the top of the file stated in the error.
The glew library downloaded can be found here: https://sourceforge.net/projects/glew/files/glew/1.5.8/glew-1.5.8-win32.zip/download
I dunno if this matters, but here's how I've referenced OpenGL and glew in my source
#pragma once
#include <gl/glew.h>
#include <gl/wglew.h>
#include <gl/GL.h>
#pragma comment(lib, "glew32.lib")
#pragma comment(lib, "opengl32.lib")
UPDATE: this error was fixed by removing the gl/GL.h include... yeah I dunno either... in any case, this whole project is acting funny...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
GLEW 安装指南 提到
glew.h
应该 替换gl.h
。另外,请查看另一个问题的此答案,了解 GLEW 的一些技巧。
The GLEW installation guide mentions that
glew.h
should replacegl.h
.Also, check out this answer to another question for some of GLEW's tricks.