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

Author Topic: OpenGL link?  (Read 3244 times)

0 Members and 1 Guest are viewing this topic.

DirtyBlasion

  • Newbie
  • *
  • Posts: 14
    • View Profile
    • Email
OpenGL link?
« on: January 23, 2017, 11:24:46 am »
So I linked every thing, you can find in the library folder. And every thing works just fine, the problem appeared when I used #include <SFML/OpenGL.h> and I got errors undefined reference, I linked from every thing that come the zip when downloaded. I need to download a new library???

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11030
    • View Profile
    • development blog
    • Email
OpenGL link?
« Reply #1 on: January 23, 2017, 11:35:17 am »
There are system libraries that you need to link as well and that aren't shipped in the zip file, because they are already part of your compiler. See the tutorial for the full list and order of SFML's dependencies.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

DirtyBlasion

  • Newbie
  • *
  • Posts: 14
    • View Profile
    • Email
Re: OpenGL link?
« Reply #2 on: January 23, 2017, 12:32:15 pm »
"You will then need to link your program to the OpenGL library. Unlike what it does with the headers, SFML can't provide a unified way of linking OpenGL. Therefore, you need to know which library to link to according to what operating system you're using ("opengl32" on Windows, "GL" on Linux, etc.). The same applies for GLU as well in case you plan on using it too: "glu32" on Windows, "GLU" on Linux, etc." and you said "they are part of compiler", so I use mingw, and I cant find anywhere in the compiler folder. Is there any place where I can download? Sorry, if I understand hard, but Im begginer after all.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: OpenGL link?
« Reply #3 on: January 23, 2017, 12:49:05 pm »
You don't need to look for the file, just add the linker command mentioned in the tutorial. Since it's a "standard" library, the linker will find it automatically.
« Last Edit: January 23, 2017, 12:50:53 pm by Laurent »
Laurent Gomila - SFML developer

DirtyBlasion

  • Newbie
  • *
  • Posts: 14
    • View Profile
    • Email
Re: OpenGL link?
« Reply #4 on: January 23, 2017, 01:28:40 pm »
I put in linker like this opengl32.lib and I got this cannot find -lopengl32.lib

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: OpenGL link?
« Reply #5 on: January 23, 2017, 02:14:13 pm »
Just put "opengl32".

This can also be found easily by Googling "how to link OpenGL with <your_compiler>" ;)
Laurent Gomila - SFML developer

DirtyBlasion

  • Newbie
  • *
  • Posts: 14
    • View Profile
    • Email
Re: OpenGL link?
« Reply #6 on: January 23, 2017, 02:26:59 pm »
Thank you, Laurent!

 

anything