Code::Blocks
October 23, 2014, 03:01:45 pm *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: The new Release 13.12 is out! You can download binaries for windows, mac and many major linux distros from  http://www.codeblocks.org/downloads/26 .
 
   Home   Help Search Login Register  :: WebsiteWiki  
Pages: [1]   Go Down
  Send this topic  |  Print  
Author Topic: GLEW undefined references[SOLVED]  (Read 5481 times)
foota
Newcomer
*
Offline Offline

Posts: 2


« 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:

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!

« Last Edit: August 08, 2010, 06:21:41 am by foota » Logged
foota
Newcomer
*
Offline Offline

Posts: 2


« 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
Logged
Pages: [1]   Go Up
  Send this topic  |  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.20 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!