Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Missing OpenGL headers on mac

I am trying to use OpenGL in mac, but when I am including the glut header, It includes the OpenGL one an then It's not able to find the OpenGL/gl.h header. I have looked the problem up in the internet, and It seems that this files should be inside the /System/Library/Frameworks/OpenGL.framework/Headers directory, but such subdirectory does not exist. I have tried reinstalling XCode and didn't work.

Any suggestions of how should I proceed.

Some specifics:
here is what /System/Library/Frameworks/OpenGL.framework/Versions/Current looks like:

localhost@Current$ ls -la
total 368
drwxr-xr-x   7 root  wheel     238 Oct  7  2012 .
drwxr-xr-x   4 root  wheel     136 Oct  7  2012 ..
drwxr-xr-x  16 root  wheel     544 Oct  7  2012 Libraries
-rwxr-xr-x   1 root  wheel  185184 Oct  3  2012 OpenGL
drwxr-xr-x   3 root  wheel     102 Jun 16  2011 PlugIns
drwxr-xr-x  14 root  wheel     476 Oct  7  2012 Resources
drwxr-xr-x   3 root  wheel     102 Oct  7  2012 _CodeSignature

Thank you all

like image 986
Andrés Avatar asked Sep 06 '13 00:09

Andrés


2 Answers

In mavericks (10.9), these got moved. The stuff in /System/Library/Frameworks no longer has any development headers; it seems to be purely a deployment build of the frameworks. So, Andés is right - he's looking exactly where he was told to look, but the files he's looking for simply aren't there.

Instead, XCode itself stores these as part of its install - XCode comes with multiple SDKs for various versions of OS X, and inside these, there are the headers for these libraries. For example:

/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/System/Library/Frameworks/OpenGL.framework/Versions/A/Headers/

like image 88
Richard Kettering Avatar answered Nov 12 '22 00:11

Richard Kettering


For everyone else who is having this problem, the solution is fairly easy. The problem is that probably not all the command line tools are installed, so the key is to install them. You just need to follow what is suggested in this post and install all the command line tools that are missing. Then you'll have a beautiful OpenGL hello world running smoothly :D :D

like image 4
Andrés Avatar answered Nov 12 '22 02:11

Andrés