0

I've been trying to install and learn use GLEW with SDL 2. I've been following this tutorial: http://headerphile.com/sdl2/opengl-part-1-sdl-opengl-awesome/

After linking all libraries and including all search directories, I'm getting the error undefined reference to `_imp__glewExperimental. I'm using Code::Blocks with GNU GCC Compiler.

Screenshots of my project build options:

search directories for the linker

enter image description here

search directories for compiler

enter image description here

linker

enter image description here

My code:

Things I've tried that haven't worked:

  • Adding GLEW_STATIC before glew.h: This gives me an undefined reference to wglGetProcAddressed
  • changing the order of linking glew32.lib and glew32s.lib I tried to manually link these two files using "Link Libraries" rather than -glew32 in "Other Linker Options" as shown in the screenshot. There is no difference regardless of what order I link them.

Not sure if it's worth mentioning or not but glewExperimental and glewGenBuffers are the only things that actually are undefined. glewInit() and other glew functions compiled fine with no problems.

If anyone can help me with this that'd be great.

Edit: I don't think this is a duplicate because all the other articles I've tried are either using some additional libraries (in which case their problems were that they didn't link all the libraries. I'm only using glew and I think I'm linking Glew correctly) or simply didn't solve my problem. Here are a list of articles I've tried:

(Just didn't help, even though this guy had a seemingly similar problem. He only compiled with glew32s.lib but this didn't work for me)

If it helps at all, my project is in debug mode rather than release mode.

Ruglord
  • 11
  • 2

0 Answers0