User forums > Help

GLEW undefined references[SOLVED]


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:

C:\path to glew\glew-1.5.5-win32\glew-1.5.5\include
C:\path to glew\glew-1.5.5-win32\glew-1.5.5\lib
-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!

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


[0] Message Index

Go to full version