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

Author Topic: How to link OpenGL on Mac OS X and Netbeans?  (Read 4644 times)

0 Members and 2 Guests are viewing this topic.

Jeffrey

  • Newbie
  • *
  • Posts: 36
    • View Profile
How to link OpenGL on Mac OS X and Netbeans?
« 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?

Hiura

  • SFML Team
  • Hero Member
  • *****
  • Posts: 4321
    • View Profile
    • Email
Re: How to link OpenGL on Mac OS X and Netbeans?
« Reply #1 on: August 01, 2012, 01:14:07 pm »
You should use -framework OpenGL on Mac OS X.
SFML / OS X developer

Jeffrey

  • Newbie
  • *
  • Posts: 36
    • View Profile
Re: How to link OpenGL on Mac OS X and Netbeans?
« Reply #2 on: August 01, 2012, 01:44:18 pm »
Thanks. Does this also works for GLU?

Knitter

  • Newbie
  • *
  • Posts: 6
    • View Profile
    • Email
Re: How to link OpenGL on Mac OS X and Netbeans?
« Reply #3 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 :)

Ceylo

  • Hero Member
  • *****
  • Posts: 2325
    • View Profile
    • http://sfemovie.yalir.org/
    • Email
Re: How to link OpenGL on Mac OS X and Netbeans?
« Reply #4 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.
Want to play movies in your SFML application? Check out sfeMovie!

 

anything