SFML community forums

Help => Window => Topic started by: Rubenknex on November 06, 2010, 06:03:10 pm

Title: Linker cannot resolve OpenGL functions
Post by: Rubenknex on November 06, 2010, 06:03:10 pm
Hello, I tried compiling the tutorial which uses OpenGL to draw a cube on the screen. However I'm getting a bunch of linker errors which probably indicate that it can't find the OpenGL functions. I thought OpenGL was included by SFML/Window.hpp?
What am I doing wrong  :x .

The errors:
1>Main.obj : error LNK2001: unresolved external symbol __imp__glClearDepth@8
1>Main.obj : error LNK2001: unresolved external symbol __imp__glClear@4
1>Main.obj : error LNK2001: unresolved external symbol __imp__glClearColor@16
1>Main.obj : error LNK2001: unresolved external symbol __imp__glEnd@0
1>Main.obj : error LNK2001: unresolved external symbol __imp__glBegin@4
1>Main.obj : error LNK2001: unresolved external symbol __imp__glDepthMask@4
1>Main.obj : error LNK2001: unresolved external symbol __imp__glRotatef@16
1>Main.obj : error LNK2001: unresolved external symbol __imp__glVertex3f@12
1>Main.obj : error LNK2001: unresolved external symbol __imp__glMatrixMode@4
1>Main.obj : error LNK2001: unresolved external symbol __imp__glViewport@16
1>Main.obj : error LNK2001: unresolved external symbol __imp__glTranslatef@12
1>Main.obj : error LNK2001: unresolved external symbol __imp__glEnable@4
1>Main.obj : error LNK2001: unresolved external symbol __imp__glLoadIdentity@0
Title: Linker cannot resolve OpenGL functions
Post by: Laurent on November 06, 2010, 06:16:22 pm
It is indeed included by SFML, but not linked. You must link to opengl32.lib.
Title: Linker cannot resolve OpenGL functions
Post by: Rubenknex on November 06, 2010, 06:57:33 pm
Ah so that's it, it works now :).
I've worked my way through the next few tutorials and SFML seems like an awesome library!  :D
Title: Linker cannot resolve OpenGL functions
Post by: Fierce_Dutch on December 08, 2010, 06:25:56 am
Quote from: "Laurent"
It is indeed included by SFML, but not linked. You must link to opengl32.lib.


Where is the Lib? I tried going to the linker and just linking it but no luck.
Title: Linker cannot resolve OpenGL functions
Post by: Rubenknex on December 08, 2010, 07:41:04 am
Which compiler do you use? I use VC++ 2008 and it can find the opengl32.lib without problems.
Title: Linker cannot resolve OpenGL functions
Post by: Laurent on December 08, 2010, 08:03:10 am
Quote
Where is the Lib? I tried going to the linker and just linking it but no luck.

Please don't duplicate questions. You already have a topic for this problem.
Title: Linker cannot resolve OpenGL functions
Post by: Fierce_Dutch on December 08, 2010, 04:30:27 pm
Quote from: "Laurent"
Quote
Where is the Lib? I tried going to the linker and just linking it but no luck.

Please don't duplicate questions. You already have a topic for this problem.


No that is just one asking how people got to OpenGL and this guy could possibly help me since I have the same errors as him...
Title: Linker cannot resolve OpenGL functions
Post by: Laurent on December 08, 2010, 04:46:14 pm
But you already ask the same question here
http://www.sfml-dev.org/forum/viewtopic.php?p=24137#24137

If you get answers here, people following the other thread won't see them.
Title: Linker cannot resolve OpenGL functions
Post by: Fierce_Dutch on December 08, 2010, 04:56:13 pm
Quote from: "Laurent"
But you already ask the same question here
http://www.sfml-dev.org/forum/viewtopic.php?p=24137#24137

If you get answers here, people following the other thread won't see them.


Ok sorry, I just thought that this would the thread for this and I would delete my other post so people could find the answer easier istead of looking in where did you start opengl