SFML community forums
Help => General => Topic started by: DirtyBlasion 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???
-
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.
-
"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.
-
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.
-
I put in linker like this opengl32.lib and I got this cannot find -lopengl32.lib
-
Just put "opengl32".
This can also be found easily by Googling "how to link OpenGL with <your_compiler>" ;)
-
Thank you, Laurent!