#include <GL/gl.h> build error

Hi, I've been following the advice in the building.txt file but I get the following error

In file included from /Users/patrick/Box2D_v2.2.1/freeglut/freeglut_callbacks.c:28:
In file included from /Users/patrick/Box2D_v2.2.1/freeglut/./freeglut.h:17:
/Users/patrick/Box2D_v2.2.1/freeglut/./freeglut_std.h:77:10: fatal error: 'GL/gl.h' file not found
#include <GL/gl.h>


I have already installed Cocos2D with Box2D included, I'm not sure if that would make a difference. I'm new to macs and Xcode, and I don't know a lot about unix so I'm a bit stuck. Has anyone got any advice?

I need to install Box2D because I want to use the testbed tool. The Xcode simulator version that comes with Cocos2D doesn't seem to have the same functionality.
Try this:

#ifdef __APPLE__
#include <OpenGL/gl.h>
#include <OpenGL/glu.h>
#else
#include <GL/glu.h>
#include <GL/gl.h>
#endif
Thanks for the reply, I tried that but it didn't work.

I found the solution is to install XQuartz, then all the right header files can be found on the system. If anyone else is having this trouble using Mountain Lion, then install XQuartz.

http://xquartz.macosforge.org/landing/
ptc79 wrote:
I found the solution is to install XQuartz, then all the right header files can be found on the system. If anyone else is having this trouble using Mountain Lion, then install XQuartz.

http://xquartz.macosforge.org/landing/


Installing XQuartz worked for me as well. I used the instructions here: http://support.apple.com/kb/HT5293
ptc79 wrote:
Thanks for the reply, I tried that but it didn't work.

I found the solution is to install XQuartz, then all the right header files can be found on the system. If anyone else is having this trouble using Mountain Lion, then install XQuartz.

http://xquartz.macosforge.org/landing/


It works. This topic helps me. Thank u All very much!

Original thread: https://box2d.org/forum/viewtopic.php?t=9175