SFML community forums

Help => General => Topic started by: Jeffrey on August 01, 2012, 12:11:39 pm

Title: How to link OpenGL on Mac OS X and Netbeans?
Post 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?
Title: Re: How to link OpenGL on Mac OS X and Netbeans?
Post by: Hiura on August 01, 2012, 01:14:07 pm
You should use -framework OpenGL on Mac OS X.
Title: Re: How to link OpenGL on Mac OS X and Netbeans?
Post by: Jeffrey on August 01, 2012, 01:44:18 pm
Thanks. Does this also works for GLU?
Title: Re: How to link OpenGL on Mac OS X and Netbeans?
Post by: Knitter on August 01, 2012, 02:00:23 pm
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 :)
Title: Re: How to link OpenGL on Mac OS X and Netbeans?
Post by: Ceylo on August 01, 2012, 02:42:09 pm
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.