1
我想在Visual Studio 2012中建立一个opengl项目。我想静态地包括glew库,所以我从源代码构建它,并将生成的glew32sd.lib复制到我的lib目录。我把这个lib路径给了Visual Studio,并把“glew32sd.lib”添加到我在VS中的其他依赖项中。链接器错误,当库静态链接时glew
现在,当我编译示例代码在main.cpp中:
#define GLEW_STATIC
#include<GL/glew.h>
int main(){
glewInit();
return 0;
}
我得到以下错误:
1> main.cpp
1>glew32sd.lib(glew.obj) : error LNK2019: unresolved external symbol [email protected] referenced in function [email protected]
1>glew32sd.lib(glew.obj) : error LNK2019: unresolved external symbol [email protected] referenced in function [email protected]
1>glew32sd.lib(glew.obj) : error LNK2019: unresolved external symbol [email protected] referenced in function [email protected]
1>C:\Projects\OpenGL\opengl\Debug\opengl.exe : fatal error LNK1120: 3 unresolved externals
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
在我的理解,这个错误应该是因为编译器找不到函数调用的定义。
这里有一些相关的快照: The Library dependencies of my project
为什么会这样的错误来吗?我尝试重建解决方案,但这也没有帮助。任何建议都会有所帮助。
它解决了这个问题!谢谢您的帮助。 – ashutosh