OpenGL编译问题
我正在使用 Visual Studio C++ 和 GLEW。项目设置已全部设置(包括/库)。
MenuState.obj : error LNK2001: unresolved external symbol __imp____glewUseProgramObjectARB
MenuState.obj : error LNK2001: unresolved external symbol __imp____glewLinkProgramARB
MenuState.obj : error LNK2001: unresolved external symbol __imp____glewAttachObjectARB
MenuState.obj : error LNK2001: unresolved external symbol __imp____glewCompileShader
MenuState.obj : error LNK2001: unresolved external symbol __imp____glewShaderSource
MenuState.obj : error LNK2001: unresolved external symbol __imp____glewCreateShader
MenuState.obj : error LNK2001: unresolved external symbol __imp____glewCreateProgramObjectARB
这些是我收到的唯一消息。一切都工作正常,直到我尝试实现着色器。 问题是我在虚拟机中工作,所以我的问题是:GLEW 是否需要 opengl32.lib 作为依赖项?因为如果我不将 opengl32.lib 添加到链接器中,我会收到更多错误。如果是这样,问题是否是由 opengl32.lib 引起的?因为我认为 opengl32.lib 是标准的 windows opengl32.lib,这意味着它只是 opengl 1.1,因此它无法链接......
那么这些错误的问题是什么?
I am using Visual Studio C++ and GLEW. The Project Settings are all set (Includes/Libs).
MenuState.obj : error LNK2001: unresolved external symbol __imp____glewUseProgramObjectARB
MenuState.obj : error LNK2001: unresolved external symbol __imp____glewLinkProgramARB
MenuState.obj : error LNK2001: unresolved external symbol __imp____glewAttachObjectARB
MenuState.obj : error LNK2001: unresolved external symbol __imp____glewCompileShader
MenuState.obj : error LNK2001: unresolved external symbol __imp____glewShaderSource
MenuState.obj : error LNK2001: unresolved external symbol __imp____glewCreateShader
MenuState.obj : error LNK2001: unresolved external symbol __imp____glewCreateProgramObjectARB
These are the only Messages I get. Everything worked fine until I tried to implement a Shader.
The Problem is I am working within a VM, so my question is: Does GLEW need opengl32.lib as a dependency? Because if I dont add the opengl32.lib to the Linker I get even more errors. And if so could the Problem be caused by the opengl32.lib? Because I think the opengl32.lib is the standard windows opengl32.lib, that would mean it's only opengl 1.1, and therefor it can't link...
So what is the issue about these errors?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
确保在 Windows 中包含 GLEW 之前在项目中
#define GLEW_STATIC
。然后您可以将整个源代码包含在项目文件中。否则,您需要在可执行文件中包含正确的 GLEW DLL 文件。Make sure to
#define GLEW_STATIC
in the project before including GLEW in Windows. Then you can just include the entire source code in your project files. Otherwise, you need to have the proper GLEW DLL file in with your executable.