天天看點

openGL産生的 error LNK2001: 無法解析的外部符号 __imp_glBegin

openGL産生的 error LNK2001: 無法解析的外部符号 __imp_glBegin

  error LNK1120: 53 個無法解析的外部指令 D:\weiLi\vs2013test\json_feature_extractor\x64\Debug\json_feature_extractor.exe json_feature_extractor   error LNK2001: 無法解析的外部符号 __imp_glBegin D:\weiLi\vs2013test\json_feature_extractor\json_feature_extractor\sift_gpu.lib(GLTexImage.obj)          json_feature_extractor

  error LNK2001: 無法解析的外部符号 __imp_glBindTexture D:\weiLi\vs2013test\json_feature_extractor\json_feature_extractor\sift_gpu.lib(GLTexImage.obj) json_feature_extractor

 error LNK2001: 無法解析的外部符号 __imp_glDrawBuffer D:\weiLi\vs2013test\json_feature_extractor\json_feature_extractor\sift_gpu.lib(GLTexImage.obj) json_feature_extractor

 error LNK2001: 無法解析的外部符号 __imp_glDrawBuffer D:\weiLi\vs2013test\json_feature_extractor\json_feature_extractor\sift_gpu.lib(PyramidGL.obj) json_feature_extractor

 error LNK2001: 無法解析的外部符号 __imp_glEnable D:\weiLi\vs2013test\json_feature_extractor\json_feature_extractor\sift_gpu.lib(GlobalUtil.obj) json_feature_extractor

 error LNK2001: 無法解析的外部符号 __imp_glEnd D:\weiLi\vs2013test\json_feature_extractor\json_feature_extractor\sift_gpu.lib(GLTexImage.obj) json_feature_extractor

 error LNK2001: 無法解析的外部符号 __imp_glFinish D:\weiLi\vs2013test\json_feature_extractor\json_feature_extractor\sift_gpu.lib(PyramidGL.obj) json_feature_extractor

 error LNK2001: 無法解析的外部符号 __imp_glFlush D:\weiLi\vs2013test\json_feature_extractor\json_feature_extractor\sift_gpu.lib(GLTexImage.obj) json_feature_extractor

 error LNK2001: 無法解析的外部符号 __imp_glFlush D:\weiLi\vs2013test\json_feature_extractor\json_feature_extractor\sift_gpu.lib(PyramidGL.obj) json_feature_extractor

 error LNK2001: 無法解析的外部符号 __imp_glGetError D:\weiLi\vs2013test\json_feature_extractor\json_feature_extractor\sift_gpu.lib(GlobalUtil.obj) json_feature_extracto

解決方法:

Visual C++ 2013 中已經提供了對 OpenGL 庫的支援,這裡主要需要配置的是 GLUT。GLUT 是一個與視窗系統無關的工具包,當我們在寫 OpenGL 程式時,可以通過 GLUT 實作簡單的視窗的建立等操作,免去了學習特定 OS 下 GUI庫的過程。

glut下載下傳位址:

http://www.opengl.org/resources/libraries/glut/glutdlls37beta.zip

将下載下傳的檔案解壓後,将把裡面的檔案移動到以下檔案夾

glut.h —> C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Include\gl

glut.dll,glut32.dll —>C:\Windows\SysWOW64 (64位作業系統)

—> C:\Windows\System32 (32位作業系統)

glut.lib,glut32.lib —> C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\lib

以上,配置成功!

還要注意

在【連接配接器->正常->附加庫目錄】在裡面選入選擇x64的庫目錄,如我自己的機器上是:C:\Program Files (x86)\Microsoft SDKs\Windows\v7.1A\Lib\x64

因為VS預設是win32的庫目錄,是以要手動加入x64庫目錄,加入之後就可以了 

繼續閱讀