在Visual Studio 2015抱怨错误LNK200上链接glew32.lib和GLEW_STATIC定义

时间:2016-09-16 13:42:40

标签: glew

我已将glew32.lib添加到链接器 - >输入 - >附加Dep,并将GLEW_STATIC定义添加到预处理器。我确定这个设置是正确的。但vs显示链接错误。它需要任何其他设置吗?我已经谷歌这个问题3天了,并且得到了任何帮助!

    1>------ Build started: Project: demo, Configuration: Debug Win32 ------
    1>libtiff-2015.lib(tif_win32.obj) : warning LNK4075: ignoring '/EDITANDCONTINUE' due to '/SAFESEH' specification
    1>LINK : warning LNK4098: defaultlib 'LIBCMT' conflicts with use of other libs; use /NODEFAULTLIB:library
    1>LINK : warning LNK4098: defaultlib 'MSVCRT' conflicts with use of other libs; use /NODEFAULTLIB:library
    1>cocox.lib(CCGLViewImpl-desktop.obj) : error LNK2001: unresolved external symbol ___glewBindFramebuffer
    1>cocox.lib(CCFrameBuffer.obj) : error LNK2001: unresolved external symbol ___glewBindFramebuffer
    1>cocox.lib(CCGLViewImpl-desktop.obj) : error LNK2001: unresolved external symbol ___glewBindRenderbuffer
    1>cocox.lib(CCFrameBuffer.obj) : error LNK2001: unresolved external symbol ___glewBindRenderbuffer
    1>cocox.lib(CCGLViewImpl-desktop.obj) : error LNK2001: unresolved external symbol ___glewCheckFramebufferStatus
    1>cocox.lib(CCFrameBuffer.obj) : error LNK2001: unresolved external symbol ___glewCheckFramebufferStatus
    1>cocox.lib(CCGLViewImpl-desktop.obj) : error LNK2001: unresolved external symbol ___glewDeleteFramebuffers
    1>cocox.lib(CCFrameBuffer.obj) : error LNK2001: unresolved external symbol ___glewDeleteFramebuffers
    1>cocox.lib(CCGLViewImpl-desktop.obj) : error LNK2001: unresolved external symbol ___glewDeleteRenderbuffers
    ....................
    1>cocox.lib(CCFrameBuffer.obj) : error LNK2001: unresolved external symbol ___glewGenFramebuffers
    1>cocox.lib(CCGLViewImpl-desktop.obj) : error LNK2001: unresolved external symbol ___glewGenRenderbuffers
    1>cocox.lib(CCFrameBuffer.obj) : error LNK2001: unresolved external symbol ___glewGenRenderbuffers
    1>cocox.lib(CCGLViewImpl-desktop.obj) : error LNK2001: unresolved external symbol ___glewGenerateMipmap
   ........................
    1>cocox.lib(ccGLStateCache.obj) : error LNK2001: unresolved external symbol ___glewDisableVertexAttribArray
    1>cocox.lib(CCCameraBackgroundBrush.obj) : error LNK2001: unresolved external symbol ___glewEnableVertexAttribArray
    1>cocox.lib(CCMeshCommand.obj) : error LNK2001: unresolved external symbol ___glewEnableVertexAttribArray
    1>cocox.lib(CCVertexAttribBinding.obj) : error LNK2001: unresolved external symbol ___glewEnableVertexAttribArray
    ................................
    1>cocox.lib(CCRenderer.obj) : error LNK2001: unresolved external symbol ___glewBufferData
    1>cocox.lib(CCDrawNode.obj) : error LNK2001: unresolved external symbol ___glewBufferData
    1>cocox.lib(CCTextureAtlas.obj) : error LNK2001: unresolved external symbol ___glewBufferData
    1>cocox.lib(CCCameraBackgroundBrush.obj) : error LNK2001: unresolved external symbol ___glewBufferData
    1>cocox.lib(CCVertexIndexBuffer.obj) : error LNK2001: unresolved external symbol ___glewDeleteBuffers
    1>cocox.lib(CCRenderer.obj) : error LNK2001: unresolved external symbol ___glewDeleteBuffers
    1>cocox.lib(CCDrawNode.obj) : error LNK2001: unresolved external symbol ___glewDeleteBuffers
    1>cocox.lib(CCTextureAtlas.obj) : error LNK2001: unresolved external symbol ___glewDeleteBuffers
    1>cocox.lib(CCCameraBackgroundBrush.obj) : error LNK2001: unresolved external symbol ___glewDeleteBuffers
    1>cocox.lib(CCVertexIndexBuffer.obj) : error LNK2001: unresolved external symbol ___glewGenBuffers
    1>cocox.lib(CCRenderer.obj) : error LNK2001: unresolved external symbol ___glewGenBuffers
    1>cocox.lib(CCDrawNode.obj) : error LNK2001: unresolved external symbol ___glewGenBuffers
    1>cocox.lib(CCTextureAtlas.obj) : error LNK2001: unresolved external symbol ___glewGenBuffers
    1>cocox.lib(CCCameraBackgroundBrush.obj) : error LNK2001: unresolved external symbol ___glewGenBuffers
    1>cocox.lib(CCRenderer.obj) : error LNK2001: unresolved external symbol ___glewMapBuffer
    1>cocox.lib(CCTextureAtlas.obj) : error LNK2001: unresolved external symbol ___glewMapBuffer
   .........................
    1>cocox.lib(CCGLProgram.obj) : error LNK2001: unresolved external symbol ___glewGetActiveAttrib
    1>cocox.lib(CCGLProgram.obj) : error LNK2001: unresolved external symbol ___glewGetActiveUniform
    .....................
    1>cocox.lib(CCGLProgram.obj) : error LNK2001: unresolved external symbol ___glewUniformMatrix4fv
    1>cocox.lib(CCVertexIndexBuffer.obj) : error LNK2001: unresolved external symbol ___glewIsBuffer
    1>G:\code\cpp\cocoxgame\vs2015\demo\Debug\demo.exe : fatal error LNK1120: 73 unresolved externals
    ========== Build: 0 succeeded, 1 failed, 5 up-to-date, 0 skipped ==========

1 个答案:

答案 0 :(得分:0)

我犯了一个错误,这个“glew32.lib”只是glew32.dll的导入库。必须用glew32s.lib替换glew32.lib。