News:

When registered with our forums, feel free to send a "here I am" post here to differ human beings from SPAM bots.

Main Menu

GLEW undefined references[SOLVED]

Started by foota, August 08, 2010, 03:03:21 AM

Previous topic - Next topic

foota

So I have a simple winapi project that uses GLEW/opengl and on compiling it gives me this error:

obj\Debug\opengl_3.o: In function `ZN13OpenGLContext15create30ContextEP6HWND__':
C:/Users/David/Downloads/!nehe/opengl/opengl_3.cpp:60: undefined reference to `glewInit'
C:/Users/David/Downloads/!nehe/opengl/opengl_3.cpp:71: undefined reference to `wglewIsSupported'
C:/Users/David/Downloads/!nehe/opengl/opengl_3.cpp:72: undefined reference to `__wglewCreateContextAttribsARB'
collect2: ld returned 1 exit status

by lurking through various threads I think the problem is that GLEW isn't being linked correctly, following advice I tried compiling GLEW statically myself however that didn't work. my current search directory settings are:

Compiler
C:\path to glew\glew-1.5.5-win32\glew-1.5.5\include
and
Linker
C:\path to glew\glew-1.5.5-win32\glew-1.5.5\lib
With
-lopengl32 set as the linker options

I have glew set as static with #define GLEW_STATIC
and libglew_static.a in \glew-1.5.5-win32\glew-1.5.5\lib
Any and all help is appreciated!


foota

OK, so I got it to compile using a dynamic library instead of the static one. Just had to add it to the current project under build options->linker settings