2012-07-28 32 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搜索目錄)。