November 24, 2014, 07:17:37 am *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: Accounts with zero posts and zero activity during the last months will be deleted periodically to fight SPAM!
   Home   Help Search Login Register  :: WebsiteWiki  
Pages: [1]   Go Down
  Send this topic  |  Print  
Author Topic: GLEW undefined references[SOLVED]  (Read 5618 times)
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:

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

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