我想在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