我想在C++中構建一個OpenGL應用程序。我使用glew和glfw庫。現在,我想創造一些紋理,但現在它說:OpenGL鏈接問題
1>model.obj : error LNK2019: unresolved external symbol __imp_glBindTexture referenced in function "public: void __cdecl Texture::Bind(unsigned int)" ([email protected]@@[email protected])
1>model.obj : error LNK2019: unresolved external symbol __imp_glGenTextures referenced in function "public: bool __cdecl Texture::Load(void)" ([email protected]@@QEAA_NXZ)
1>model.obj : error LNK2019: unresolved external symbol __imp_glTexImage2D referenced in function "public: bool __cdecl Texture::Load(void)" ([email protected]@@QEAA_NXZ)
1>model.obj : error LNK2019: unresolved external symbol __imp_glTexParameterf referenced in function "public: bool __cdecl Texture::Load(void)" ([email protected]@@QEAA_NXZ)
1>C:\Users\Dynamitos5\Documents\cuda\OpenGLTest\external\lib\magickdb.lib : warning LNK4272: library machine type 'X86' conflicts with target machine type 'x64'
1>C:\Users\Dynamitos5\Documents\cuda\OpenGLTest\external\lib\magickrl.lib : warning LNK4272: library machine type 'X86' conflicts with target machine type 'x64'
1>C:\Users\Dynamitos5\Documents\cuda\OpenGLTest\x64\Debug\OpenGLTest3.exe : fatal error LNK1120: 16 unresolved externals
一切工作至今(glGenVertexArrays(),(4,8)等),只紋理函數(glGenTextures(),glBindTexture()等)不起作用。 接頭是建立這樣的:glew32.lib;glfw3.lib;assimp.lib;devil.lib;magickdb.lib;magickrl.lib;%(AdditionalDependencies)
VC包括DIR: C:\Users\Dynamitos5\Documents\cuda\OpenGLTest\external\include;$(IncludePath)
VC lib目錄: C:\Users\Dynamitos5\Documents\cuda\OpenGLTest\external\lib;$(LibraryPath)
你是否缺少opengl32.lib? – BDL
@BDL我認爲opengl32.lib只適用於已棄用的OpenGL1.1內容。我的錯誤理解/ _ \。我會接受它,如果你把它作爲回答 – Dynamitos