Skip to main content
GameDev.net gamedev.net
🔒 Locked

GLEW linker errors

Started by CDProp Sep 6, 2010 at 3:49 PM 4 replies 5.1k views
Original Post
CDProp
CDProp
Heya,

Darnedest thing. I've done several OpenGL-based projects before, using GLEW. Unfortunately, I don't have access to them because they're on an old hard drive that I can't access at the moment.

In any case, I've installed GLEW on my new machine, and as far as I can tell, I followed the directions correctly. I am using VC++ Express 2010. I am linking to glew32.lib as well as glu32.lib and opengl32.lib, and the linker is not complaining about any missing lib files or anything like that. However, it still can't seem to find the definition for some of the glew functions that I'm using (using source tags for scroll bar purposes =)):

Error	1	error LNK2001: unresolved external symbol __imp____glewCompileShader	C:\Development\Demos\ProjectiveWaterDemo\ProjectiveWaterDemo\GLShader.objError	2	error LNK2001: unresolved external symbol __imp____glewShaderSource	C:\Development\Demos\ProjectiveWaterDemo\ProjectiveWaterDemo\GLShader.objError	3	error LNK2001: unresolved external symbol __imp____glewCreateShader	C:\Development\Demos\ProjectiveWaterDemo\ProjectiveWaterDemo\GLShader.objError	4	error LNK2001: unresolved external symbol __imp____glewDeleteShader	C:\Development\Demos\ProjectiveWaterDemo\ProjectiveWaterDemo\GLShader.objError	5	error LNK1120: 4 unresolved externals	C:\Development\Demos\ProjectiveWaterDemo\Debug\ProjectiveWaterDemo.exe	1


Does anyone have any experience with this?
AndyEsser
AndyEsser
Are you #include'ing the correct header files?
CDProp
CDProp
Yessir, I believe so. I'm not getting any compile errors, in any case.

As a hold-over I've just been using glext.h, which seems to be working well (although I did try compiling a shader that simply says "this is a test shader" [one word per line] and the info log told me that the vertex shader compiled without errors, lol).
sprite_hound
sprite_hound
Are you sure the version of the lib it's finding is the dll export lib, rather than the static lib (glew32s.lib), and that you're linking to the one you want? If you're after the static version, you need to put #define GLEW_STATIC before the header include.
CDProp
CDProp
I would prefer the DLL version. I'm linking to glew32.lib (no s).
Dragonion
Dragonion
What a coincident - I am experiencing the exact same linker errors, and I also just downloaded the latest version of GLEW :?

I did figure out why, though: if you open glew32.lib and compare it with the linker function names references, an underscore character is misplaced in these four functions :/

EDIT: I just compared them again, and apparently all functions with the __imp prefix in glew32.lib except

__imp__glewExperimental
__imp__glewGetErrorString
__imp__glewGetExtension
__imp__glewGetString
__imp__glewInit
__imp__glewIsSupported
__imp__wglewGetExtension
__imp__wglewIsSupported

have two additional prefixed underscore characters after "__imp" (eg. __imp____wglewSetStereoEmitterState3DL)

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.