Glew linker errors

Started by
2 comments, last by yahastu 13 years, 4 months ago
I'm using MSVC 2008. I can compile and run projects using Glut without issue. Now I am trying to include Glew. This is what I have done:

1) Downloaded the latest version of Glew from
http://glew.sourceforge.net/install.html

2) Installed glew files into the following (recommended) directories:

C:\Windows\System32\glew32.dll
C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\lib\glew32.lib
C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\lib\glew32s.lib
C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\include\GL\glew.h
C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\include\GL\glexw.h
C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\include\GL\wglew.h

3) Added the following as Additional Dependencies under Linker Input,
opengl32.lib glu32.lib glut32.lib glew32.lib glew32s.lib

4) #include <GL/glew.h> before glut

When I compile, it still says:

1>Compiling...
1>main.cpp
1>Note: including lib: glut32.lib
1>Linking...
1>main.obj : error LNK2001: unresolved external symbol __imp__glewInit
1>main.obj : error LNK2001: unresolved external symbol __imp__glewGetString
1>main.obj : error LNK2001: unresolved external symbol __imp__glewGetErrorString

So...why aren't the libraries getting linked in?
Advertisement
btw, I have also tried defining GLEW_STATIC and GLEW_BUILD, but the results are unchanged.
Are you sure you're supposed to include glew32 and glew32s at the same time? I think one is for static and the other is for dynamic linking, I think you have to pick whether you want static or dynamic linking and go with that lib only.

I don't know if doubly including those would cause your error, but it seems incorrect.

Try just glew32.lib, with no preprocessor commands (those are only needed if you include glew.c in your project from my understanding).
[size=2]My Projects:
[size=2]Portfolio Map for Android - Free Visual Portfolio Tracker
[size=2]Electron Flux for Android - Free Puzzle/Logic Game
Yeah I didn't think the preprocessor definitions were necessary. If I remove glew32s from the list it doesn't make a difference.

This topic is closed to new replies.

Advertisement