SFML community forums
Help => General => Topic started by: Jeffrey on August 01, 2012, 12:11:39 pm
-
I've read the tutorial about using OpenGL in SFML. I've added the library via #include<SFML/OpenGL.hpp>.
Then it says I have to link it in my project. So in the linker I've added -lGL -lGLU as described in tutorials online on how to link opengl. But I get an error "library not found for -lGL".
So how do I link correctly OpenGL?
-
You should use -framework OpenGL on Mac OS X.
-
Thanks. Does this also works for GLU?
-
Depends on where your GLU is located and how it has been installed. For any library you have installed as a framework (like OpenGL) you should use the -frameworks option. If you're trying to use some library you installed using systems like MacPorts, the -l flag is the correct option.
If you don't know what MacPorts is or never installed libraries with it then forget I mentioned :)
-
GLU is in the OpenGL framework, thus linking against that framework is enough.
Plus this OpenGL framework is always provided with the OS thus there's no need to install anything.