GLEW 和 Freeglut 不能一起工作吗?
我正在尝试在当前使用 Freeglut 的 OpenGL 应用程序中使用几何着色器,并且我正在尝试使用 GLEW 来执行此操作,因为据我了解,几何着色器功能位于扩展中。我的包含顺序如下:
#define GLEW_STATIC
#include <glew.h>
#include "freeglut.h"
但是,当我这样做时,我收到很多链接器错误,如下所示:
error LNK2001: unresolved external symbol ___glewAttachShader
当我只使用基本的 OpenGL 功能(即它,扩展中没有的东西)时,我没有收到任何错误,所以我知道编译器正在查找所有“基本”库,例如 glu32 等。我正在使用 Visual Studio 2008。有什么建议吗?
I am trying to use geometry shaders in my OpenGL application that is currently using Freeglut, and I am trying to use GLEW to do that because as I understand it, the geometry shader functionality is in an extension. My include order is as follows:
#define GLEW_STATIC
#include <glew.h>
#include "freeglut.h"
However when I do this I get lots of linker errors like the following:
error LNK2001: unresolved external symbol ___glewAttachShader
I do not receive any errors when I only use the basic OpenGL functionality (that it, things that are not in the extensions) so I know that the compiler is finding all the "basic" libraries like glu32 etc. I am using Visual Studio 2008. Any suggestions?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这是一个链接器错误,表明它没有找到 glew 入口点。
链接到 glew 库(我认为您之前没有看到错误,因为您没有使用任何扩展)。
编辑:
实际上,这与您使用“GLEW_STATIC”有直接关系。
从 GLEW 页面:
这意味着,当您使用 GLEW_STATIC 设置时,您有责任构建并包含 glew 源文件。
It's a linker error that says it did not find a glew entrypoint.
Link against the glew library (you did not see the error before because you did not use any extension, I assume).
Edit:
Actually, this is directly related to your usage of "GLEW_STATIC".
From the GLEW page:
What this says is that it is your responsibility to build and include the glew source files when you use the GLEW_STATIC setup.