Search code examples
visual-studio-2010glew

Glew in VS 2010: unresolved external symbol __imp__glewInit


I am learning OpenGL by following the Redbook. When I come to around page 90, I need use glGenBuffers(); Then I need to install "glew".

By following the steps in here.

I download glew.zip from glew.sourceforge.net/ and unpack the files.

I put

  • glew.h in C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Include
  • glew32.lib in C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Lib, and
  • glew32.dll in C:\Windows\System32

After that, I build my project in VS 2010 and in Linker->input, I add dependencies glew32.lib.

But when I build it, I have an error:

unresolved external symbol __imp__glewInit

Solution

  • I need to compile the source code of glew.

    How to compile it, see: OpenGL: How to compile glew32.dll from source file.

    Then you will get glew32d.dll and glew32d.lib.

    • Put glew32d.dll in c:\windows\sysWOW64 (I also put it in system and system32).
    • Put glew32d.lib in C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Lib
    • Put glew.h in C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Include

    Then it will work.