Reputation: 33
I am trying to use glew 1.10.0 with the latest XCode(5.0.2) an the latest Mac OsX version. So far, I have tried different things:
I am always getting the error "'GL/glew.h' file not found"
Upvotes: 3
Views: 10241
Reputation: 43369
Since there is a single library you link to whether you get the legacy OpenGL 2.1 renderer or a core 3.2+ renderer, GLEW is completely unnecessary on OS X. This means that things from OpenGL 3.2+ will resolve at link-time (before you even have a render context to check whether it is supported or not). If you try to use functions that are not implemented by your renderer at run-time however, you will either get a GL_INVALID_OPERATION
error or the operation will silently fail. It is a difference between link-time (OS X) and run-time (Windows, Linux, etc.) resolution of GL functions.
Just include <OpenGL/gl3.h>
if you are going to use functionality from OpenGL 3.2+ core on OS X and forget about GLEW. The set of implemented extensions across all hardware OS X officially supports is relatively homogeneous depending more on the renderer version than the actual hardware vendor (Apple writes all of the drivers). You should refer to this matrix that Apple publishes for more details on GL capabilities, rather than relying on GLEW.
Upvotes: 5
Reputation: 5674
You need to add the glew include files to the HEADER_SEARCH_PATHS
located in the project settings, then you will be able to compile.
But be aware that GLEW is completelly unnecessary on OSX. OSX already comes with OpenGL and all the extensions for the "modern OpenGL" already prepared to be used. You really don't need GLEW for anything.
Upvotes: 0