OpenGL linker problem

Oct 24, 2012 at 7:56pm
Hey agian, I installed Sfml and have been using it witout error and now I decided to try out the openGL capabilities.

unresolved external symbol __imp__glClear@4

From the glClear command, everything is a linker error!
Everything that has gl before it fails, my code is good an I included correctly, is this a bug or me installing sfml wrong?
Oct 24, 2012 at 9:11pm
Have you linked OpenGL into your project?
Oct 24, 2012 at 9:14pm
add
-lGLU -lGL
to your compiler options ( if you are using gcc [g++] )
Oct 24, 2012 at 10:23pm
Im using MSVC 2010
Oct 24, 2012 at 10:40pm
Try adding #pragma comment(lib, "opengl32")
Oct 24, 2012 at 11:09pm
1
2
#pragma comment(lib, "glu32")
#pragma comment(lib, "opengl32")  


Did not work, gave me linker errors still
Oct 24, 2012 at 11:14pm
Are you sure you are linking sfml properly?
Oct 24, 2012 at 11:31pm
Everything else has worked properly, opengl started the problem...
Oct 25, 2012 at 8:10pm
Nobody?
Oct 25, 2012 at 8:28pm
You can try the VS2010 SFML project wizard I made http://code.google.com/p/sfml-project-wizard/downloads/list this will add an sfml project option when creating new projects. All you need to do is enter the path to SFML root directory and choose static or dynamic.
Oct 27, 2012 at 12:01am
Did you add "SFML/Graphic.hpp" to your program? OpenGL headers is included in that header.
BTW, you should add -lsfml-graphics option for linking.

SFML VS tutorial:
http://www.sfml-dev.org/tutorials/1.6/start-vc.php
Topic archived. No new replies allowed.