Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Linker cannot resolve OpenGL functions  (Read 4857 times)

0 Members and 1 Guest are viewing this topic.

Rubenknex

  • Newbie
  • *
  • Posts: 21
    • View Profile
Linker cannot resolve OpenGL functions
« 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

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Linker cannot resolve OpenGL functions
« Reply #1 on: November 06, 2010, 06:16:22 pm »
It is indeed included by SFML, but not linked. You must link to opengl32.lib.
Laurent Gomila - SFML developer

Rubenknex

  • Newbie
  • *
  • Posts: 21
    • View Profile
Linker cannot resolve OpenGL functions
« Reply #2 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

Fierce_Dutch

  • Full Member
  • ***
  • Posts: 138
    • View Profile
Linker cannot resolve OpenGL functions
« Reply #3 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.

Rubenknex

  • Newbie
  • *
  • Posts: 21
    • View Profile
Linker cannot resolve OpenGL functions
« Reply #4 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.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Linker cannot resolve OpenGL functions
« Reply #5 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.
Laurent Gomila - SFML developer

Fierce_Dutch

  • Full Member
  • ***
  • Posts: 138
    • View Profile
Linker cannot resolve OpenGL functions
« Reply #6 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...

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Linker cannot resolve OpenGL functions
« Reply #7 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.
Laurent Gomila - SFML developer

Fierce_Dutch

  • Full Member
  • ***
  • Posts: 138
    • View Profile
Linker cannot resolve OpenGL functions
« Reply #8 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

 

anything