0

So I'm trying to learn OpenGL/SDL development using Code::Blocks.

I've setup GLEW and SLD2 correctly in Code::Blocks according to this tutorial: http://youtu.be/UwpZOwT9nVc

First I set all the correct linker settings for my compiler: -lmingw32 -lSDL2main -lSDL2 -lSDL2_image -lSDL2_mixer -lopengl32 -lglu32 -lglew32 -lglew32mx

and added all the approviate search directories for SDL2...

Then I go into project build options and add the link libraries: GL GLEW SDL2 to Debug and Release

Then in my display class, I include GL/glew.h as done similiarly to this tutorial: http://youtu.be/DkiKgQRiMRU?list=PLEETnX-uPtBXT9T-hD0Bj31DSnwio-ywh

But when I build, I get this error message from my ld.exe file: "cannot find -GL" ... "cannot find -lGLEW"

Am I not putting something in the right folder? What else am I missing?

genpfault
  • 51,148
  • 11
  • 85
  • 139
Roane
  • 13
  • 3
  • Add directory to the list of directory to be searched for. Or copy the library to one of the standard directories.As [This](http://stackoverflow.com/questions/12107422/ld-cannot-find-llibrary) post says. – Aabesh Karmacharya Jan 21 '15 at 19:01
  • Originally, I was getting this error, and now I'm still getting it: undefined reference to `_imp__glewInit@0' ... C:\SDL\SDL2-2.0.3\i686-w64-mingw32\lib\libSDL2main.a(SDL_windows_main.o):SDL_windows_main.c|| undefined reference to `SDL_main'| – Roane Jan 23 '15 at 04:35
  • You need to use `int main(int argc, char* argv[])` and not `void main()` or just `int main()`. – Aabesh Karmacharya Jan 23 '15 at 09:36
  • ok, now I'm getting "undefined reference to `_imp__glewInit@0' ... what does that indicate? – Roane Jan 27 '15 at 02:41
  • Looks like I fixed it. The display window shows now. Looks like I may have had the wrong copy of the glew32.dll in my project folder and debug folder. – Roane Jan 27 '15 at 13:25

0 Answers0