Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 3 of 3

Thread: error LNK2001: unresolved external symbol ___glewBindBuffer

  1. #1
    Newbie Newbie
    Join Date
    Jun 2013
    Posts
    1

    error LNK2001: unresolved external symbol ___glewBindBuffer

    I use Windows 7 and 8 and Visual Studio 2010 and 2012. In all combinations I get this error message when trying to build some examples:

    Code :
    1>------ Rebuild All started: Project: 6E test, Configuration: Release Win32 ------
    1>  example1.cpp
    1>c:\users\student\downloads\6e_example1_vc10\6e test\code\Angel.h(65): warning C4305: 'initializing' : truncation from 'double' to 'const GLfloat'
    1>c:\users\student\downloads\6e_example1_vc10\6e test\code\mat.h(698): warning C4244: '=' : conversion from 'double' to 'GLfloat', possible loss of data
    1>c:\users\student\downloads\6e_example1_vc10\6e test\code\mat.h(699): warning C4244: '=' : conversion from 'double' to 'GLfloat', possible loss of data
    1>c:\users\student\downloads\6e_example1_vc10\6e test\code\mat.h(700): warning C4244: '=' : conversion from 'double' to 'GLfloat', possible loss of data
    1>c:\users\student\downloads\6e_example1_vc10\6e test\code\mat.h(721): warning C4244: '=' : conversion from 'double' to 'GLfloat', possible loss of data
    1>c:\users\student\downloads\6e_example1_vc10\6e test\code\mat.h(723): warning C4244: '=' : conversion from 'double' to 'GLfloat', possible loss of data
    1>c:\users\student\downloads\6e_example1_vc10\6e test\code\mat.h(726): warning C4244: '=' : conversion from 'double' to 'GLfloat', possible loss of data
    1>c:\users\student\downloads\6e_example1_vc10\6e test\code\mat.h(742): warning C4244: '=' : conversion from 'double' to 'GLfloat', possible loss of data
    1>  InitShader.cpp
    1>c:\users\student\downloads\6e_example1_vc10\6e test\code\Angel.h(65): warning C4305: 'initializing' : truncation from 'double' to 'const GLfloat'
    1>c:\users\student\downloads\6e_example1_vc10\6e test\code\mat.h(698): warning C4244: '=' : conversion from 'double' to 'GLfloat', possible loss of data
    1>c:\users\student\downloads\6e_example1_vc10\6e test\code\mat.h(699): warning C4244: '=' : conversion from 'double' to 'GLfloat', possible loss of data
    1>c:\users\student\downloads\6e_example1_vc10\6e test\code\mat.h(700): warning C4244: '=' : conversion from 'double' to 'GLfloat', possible loss of data
    1>c:\users\student\downloads\6e_example1_vc10\6e test\code\mat.h(721): warning C4244: '=' : conversion from 'double' to 'GLfloat', possible loss of data
    1>c:\users\student\downloads\6e_example1_vc10\6e test\code\mat.h(723): warning C4244: '=' : conversion from 'double' to 'GLfloat', possible loss of data
    1>c:\users\student\downloads\6e_example1_vc10\6e test\code\mat.h(726): warning C4244: '=' : conversion from 'double' to 'GLfloat', possible loss of data
    1>c:\users\student\downloads\6e_example1_vc10\6e test\code\mat.h(742): warning C4244: '=' : conversion from 'double' to 'GLfloat', possible loss of data
    1>..\CODE\InitShader.cpp(17): warning C4996: 'fopen': This function or variable may be unsafe. Consider using fopen_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
    1>          C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\stdio.h(218) : see declaration of 'fopen'
    1>example1.obj : error LNK2001: unresolved external symbol ___glewBindBuffer
    1>example1.obj : error LNK2001: unresolved external symbol ___glewVertexAttribPointer
    1>example1.obj : error LNK2001: unresolved external symbol ___glewGenVertexArrays
    1>example1.obj : error LNK2001: unresolved external symbol ___glewUseProgram
    1>example1.obj : error LNK2001: unresolved external symbol ___glewBufferData
    1>example1.obj : error LNK2001: unresolved external symbol ___glewBindVertexArray
    1>example1.obj : error LNK2001: unresolved external symbol ___glewGetAttribLocation
    1>example1.obj : error LNK2001: unresolved external symbol ___glewGenBuffers
    1>example1.obj : error LNK2001: unresolved external symbol ___glewEnableVertexAttribArray
    1>InitShader.obj : error LNK2001: unresolved external symbol ___glewCreateShader
    1>InitShader.obj : error LNK2001: unresolved external symbol ___glewGetShaderInfoLog
    1>InitShader.obj : error LNK2001: unresolved external symbol ___glewLinkProgram
    1>InitShader.obj : error LNK2001: unresolved external symbol ___glewCompileShader
    1>InitShader.obj : error LNK2001: unresolved external symbol ___glewShaderSource
    1>InitShader.obj : error LNK2001: unresolved external symbol ___glewGetProgramiv
    1>InitShader.obj : error LNK2001: unresolved external symbol ___glewGetShaderiv
    1>InitShader.obj : error LNK2001: unresolved external symbol ___glewGetProgramInfoLog
    1>InitShader.obj : error LNK2001: unresolved external symbol ___glewCreateProgram
    1>InitShader.obj : error LNK2001: unresolved external symbol ___glewAttachShader
    1>C:\Users\student\Downloads\6E_example1_VC10\6E test\Release\6E test.exe : fatal error LNK1120: 19 unresolved externals
    ========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========

    What can be done about this? I saw somebody else had a similar problem due to linking the 64 bit version of glew instead of the 32 bit verion, ho do I check that my version is the 32 bit version? Why should I use the 32 bit version and not the 64 bit version?

  2. #2
    Senior Member OpenGL Pro
    Join Date
    Jan 2012
    Location
    Australia
    Posts
    1,109
    You haven't included the glew library

  3. #3
    Advanced Member Frequent Contributor
    Join Date
    Aug 2004
    Location
    munich, germany
    Posts
    659
    the output says you are building a 32 bit version ("Release Win32"). and since you cannot mix 32 and 64 bit, you need the 32 bit version of your lib.
    if i remember correctly, in visual studio there is an option project/properties. when you click it, a gui opens in which you can set compiler and linker
    options. somewhere in the linker options, there is a sub-option "input", where the libs you are using are listed.

    edit: i found a screenshot in the web which shows the project/property dialog. the linker/input option is selected, and in "additional dependencies"
    you see the libs that are used.

    http://infosys.beckhoff.com/index.ph..._setup.htm&id=
    Last edited by RigidBody; 06-03-2013 at 02:20 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •