Hi all, I'm new here. So forgive me if this is obvious, but I've been struggling for hours on this today!
PROBLEM
I'm following an SDL/OpenGL tutorial on Youtube (
https://www.youtube.com/watch?v=8t3m2mRH7qs). I'm trying to get my project to compile, but I'm getting errors such as the ones listed below.
I'm 99% sure this is a linker issue.
ERRORS
undefined reference to 'glClearColor@16'
undefined reference to 'glClearDepth@8'
undefined reference to 'glClear@4'
undefined reference to 'glClearDepth@8'
undefined reference to 'glClear@4'
VERSIONS AND COMPUTER SPECS
IDE: Code Blocks 16.0.1
SDL: SDL2-2.0.4
GLEW: glew-1.13.0
Operating System: Windows 7
LINKING:
glew32s.lib
glew32.lib.
libSDL2.a
libSDL2main.a
libSDL2.dll.a.
In Build Options I put this in "Other linker options:"
-lmingw32 -lSDL2main -lSDL2
... tried adding -lglew32, -lglew32s, and all variations of those I could think of to no avail.
INCLUDING
glew.h
SDL.h
COMPILER
GNU GCC Compiler
SOLUTIONS I'VE TRIED
* Adding "#define GLEW_STATIC" to the top of my MainGame.h header file.
* Making sure that glew32s.lib is at the top of my list of linked libraries
* (Repeat of above) Tried adding -lglew32, -lglew32s, and all variations of those I could think of to the linker options... but to no avail.
* Made sure "Search Directories" was pointing to both the include and lib folders for GL.
Please help me. As a robotics professor once told me, "If you get stuck on something, don't struggle. Stand on the shoulders of giants-- your fellow programmers."