2012-07-28 46 views
1

我想学习OpenGL并使用openglbook.com作为参考。我试图让GLEW和freeglut在我的电脑上工作,所以我开始着手完成他在这里使用Visual Studio进行工作的步骤:http://openglbook.com/setting-up-opengl-glew-and-freeglut-in-visual-c。我正在关注这封信,唯一的区别是我正在使用Visual Studio 2010 Ultimate。无法使用VS2010处理GLEW,链接器错误

当我尝试使用GLEW时出现此问题;当发生这种情况时,我得到一个链接器错误。以下是错误信息的全文:

1>------ Build started: Project: gl1, Configuration: Debug Win32 ------ 
1>Build started 2012/07/28 20:12:19. 
1>InitializeBuildStatus: 
1> Touching "Debug\gl1.unsuccessfulbuild". 
1>ClCompile: 
1> All outputs are up-to-date. 
1>ManifestResourceCompile: 
1> All outputs are up-to-date. 
1>main.obj : error LNK2019: unresolved external symbol [email protected] referenced in function _Initialize 
1>main.obj : error LNK2019: unresolved external symbol [email protected] referenced in function _Initialize 
1>c:\users\magpie\documents\visual studio 2010\Projects\gl1\Debug\gl1.exe : fatal error LNK1120: 2 unresolved externals 
1> 
1>Build FAILED. 
1> 
1>Time Elapsed 00:00:00.84 
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ========== 

任何帮助?当我第一次遇到这个错误时,我尝试从源代码编译GLEW,但是这并没有解决它(假设我没有做到这一点)。

回答

2

此错误意味着编译器无法找到头文件中描述的方法的实现。要使用应用程序静态编译GLEW,请将glew32.lib文件添加到库搜索目录(项目属性 - > VC搜索目录)。