Author Topic: GLEW undefined references[SOLVED]  (Read 6785 times)

Offline foota

  • Single posting newcomer
  • *
  • Posts: 2
GLEW undefined references[SOLVED]
« on: August 08, 2010, 03:03:21 am »
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!

« Last Edit: August 08, 2010, 06:21:41 am by foota »

Offline foota

  • Single posting newcomer
  • *
  • Posts: 2
Re: GLEW undefined references
« Reply #1 on: August 08, 2010, 06:21:27 am »
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