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

Author Topic: OpenGL linking errors  (Read 5701 times)

0 Members and 1 Guest are viewing this topic.

Foaly

  • Sr. Member
  • ****
  • Posts: 453
    • View Profile
OpenGL linking errors
« on: August 17, 2010, 11:31:29 am »
Hey guys,
i am new to SFML and so far i found it awesome! But now i got a little problem. I'm trying to make a little game and it all worked pretty well. Then i tried to add some animations. So i used these animation classes of the wiki. After adding the pausableclock.hpp it compiled, but then i got a bunch of linking errors such as:  undefined reference to glbegin@4. They all point to some OpenGl functions. So my question is can anybody tell me how to link that? According to the tutorial a simple adding of the window library should do it. Some how it doesnt work so. i linked my libraries like that:
-lsfml-graphics-d
-lsfml-audio-d
-lsfml-window-d
-lsfml-system-d

So can somebody please help me?

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
OpenGL linking errors
« Reply #1 on: August 17, 2010, 11:57:03 am »
If you use OpenGL, you must link to OpenGL ("GL" on Linux, "opengl32" on Windows) ;)
Laurent Gomila - SFML developer

Foaly

  • Sr. Member
  • ****
  • Posts: 453
    • View Profile
OpenGL linking errors
« Reply #2 on: August 17, 2010, 03:24:33 pm »
sweet thanks for the fast reply!
im using windows so i need to use opengl32. what directory is the library in? i could find it. should i just add it to the environment settings like the other libs? what is the linker flag?
haha thanks in advance!

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
OpenGL linking errors
« Reply #3 on: August 17, 2010, 08:00:55 pm »
OpenGL libraries are provided with the compiler, you just need to add it to the linker options.
Laurent Gomila - SFML developer

Foaly

  • Sr. Member
  • ****
  • Posts: 453
    • View Profile
OpenGL linking errors
« Reply #4 on: August 18, 2010, 06:40:00 pm »
Ah ok thank you very much. I just added a -lopengl32 and it worked. Thanks again!