tags:

views:

131

answers:

2

In /usr/include ,

I tried grepping for GL gl and OpenGL .. .but can't find it.

Where are these header files located?

+5  A: 

They are located at /System/Library/Frameworks/OpenGL.framework/Headers. To include them, just use:

   #include <OpenGL/gl.h>
   #include <OpenGL/glu.h>
   #include <OpenGL/glext.h>
   #include <GLUT/glut.h>

etc. Make sure to link against the appropriate frameworks, eg)

cc <your_file.c> -framework GLUT -framework OpenGL 

for OpenGL and GLUT

mbarnett
There's no need to include glut.h unless you are using GLUT. When you are using GLUT there's no need to include gl.h or glu.h, since glut.h includes gl.h and glu.h, but you have to add both the GLUT and OpenGL frameworks to an Xcode project.
Mr. Berna
A: 

XCode automatically exposes all header files from a framework added to a project via the framework's name. So, "cocoa.h" is part of "cocoa.framework" - hence `#include '

OpenGl is included <OpenGL/gl.h> rather than the more expected <gl/gl.h> on other platforms.

Chris Becke