title: MAC 10.7 : Where is the gl.h file?
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/10866331/freeglut-on-mac-os-x-lion">FreeGLUT on Mac OS X Lion</a>  </p>
  </blockquote>
  
  
  
  <p>First quizz : could anyone just please explain me why am I not able to find the gl.h file anywhere on my mac ?! If this question can simply be answered maybe you do not even have to read the rest, but I couldn't find any answer on the web to that one (after hours of research), except the famous "it's integrated into the os" or something like that.</p>
  
  <hr>
  
  <p>My problem In detail:</p>
  
  <p>I am having an issue with the compilation of a .c file using OpenGL. Ihave browsed the web for hours without finding any solution. Here is the problem :</p>
  
  <p>For those who know this software, I am using Webots (a robot simulation software) and I would like to implement a physic plugin. I copied the code from an already existing (and working) plugin, just to try it out. I am compiling with webots, which uses a gcc (I had to install a gcc compiler since it doesn't come with Xcode anymore). </p>
  
  <p>Now, the problem is that the .c file includes a "physics.h" header which includes the OpenGL/gl.h file and I then get the error : "OpenGL/gl.h . no such file or directoy".</p>
  
  <p>Now I've tried to many things :</p>
  
  <ul>
  <li><p>making a search for gl.h : it seems it doean't exist (I can't find it, either manually or with the finder search function)</p></li>
  <li><p>replacing the include OpenGL/gl.h by GLUT/glut.h : I get the error "gl.h and glu.h no such fil or directory" since their included in the glut.h</p></li>
  <li><p>linking the gl libraries in the makefile and the frameworks as well</p></li>
  <li><p>Probably all the combination of these, using absolute or relative path !</p></li>
  </ul>
  
  <p>Since OpenGL and GLUT are supposed to be natively installed with OS (I am on using Lion 10.7.5) I guess every needed file should be there. And for this reaon I cannot find a way to download this supposedely missing file... </p>
  
  <p>Moreover a coworker of mine tried and successfully compiled it on linux ! Linux is a great platform but I still love my mac, so please let me hope there is another solution than to change for linux !!!</p>
  
  <p>I think my problem lies either in the Makefile or in the physic.h file, so here they are :</p>
  
  <p><code>Physic.h</code>:</p>
  
  <pre><code>#ifndef PHYSICS_H
  #define PHYSICS_H
  #include &lt;ode/ode.h&gt;
  #ifdef WIN32
  #include &lt;windows.h&gt;
  #endif
  #ifndef MACOS
  #include &lt;GL/gl.h&gt;
  #else
  #include &lt;OpenGL/gl.h&gt;
  #endif
  
  /* callback functions to be implemented in your physics plugin */
  #ifdef __cplusplus
  extern "C" {
  #endif
  #ifdef _MSC_VER
  #define DLLEXPORT __declspec(dllexport)
  #else
  #define DLLEXPORT
  #endif
  DLLEXPORT void webots_physics_init(dWorldID,dSpaceID,dJointGroupID);
  DLLEXPORT int  webots_physics_collide(dGeomID,dGeomID);
  DLLEXPORT void webots_physics_step();
  DLLEXPORT void webots_physics_step_end();
  DLLEXPORT void webots_physics_cleanup();
  DLLEXPORT void webots_physics_draw();
  DLLEXPORT void webots_physics_predraw();
  
  /* utility functions to be used in your callback functions */
  #ifndef LINUX
  extern dGeomID (*dWebotsGetGeomFromDEFProc)(const char *);
  extern dBodyID (*dWebotsGetBodyFromDEFProc)(const char *);
  extern void    (*dWebotsSendProc)(int,const void *,int);
  extern void*   (*dWebotsReceiveProc)(int *);
  extern void    (*dWebotsConsolePrintfProc)(const char *, ...);
  extern double  (*dWebotsGetTimeProc)();
  #define dWebotsGetGeomFromDEF(DEFName)    (*dWebotsGetGeomFromDEFProc)(DEFName)
  #define dWebotsGetBodyFromDEF(DEFName)    (*dWebotsGetBodyFromDEFProc)(DEFName)
  #define dWebotsSend(channel,buff,size)    (*dWebotsSendProc)(channel,buff,size)
  #define dWebotsReceive(size_ptr)          (*dWebotsReceiveProc)(size_ptr)
  
  #if defined(__VISUALC__) || defined (_MSC_VER) || defined(__BORLANDC__)
  #define dWebotsConsolePrintf(format, ...) (*dWebotsConsolePrintfProc)(format, __VA_ARGS__)
  #else
  #define dWebotsConsolePrintf(format, ...) (*dWebotsConsolePrintfProc)(format, ## __VA_ARGS__)
  #endif
  
  #define dWebotsGetTime()                  (*dWebotsGetTimeProc)()
  #else
  dGeomID dWebotsGetGeomFromDEF(const char *DEFName);
  dBodyID dWebotsGetBodyFromDEF(const char *DEFName);
  void    dWebotsSend(int channel,const void *buffer,int size);
  void   *dWebotsReceive(int *size);
  void    dWebotsConsolePrintf(const char *format, ...);
  double  dWebotsGetTime();
  #endif
  #ifdef __cplusplus
  }
  #endif
  
  #endif /* PHYSICS_H */
  </code></pre>
  
  <p><strong>Makefile:</strong></p>
  
  <pre><code>###
  ### Standard Makefile for Webots physics plugins
  ###
  ### Supported platforms: Windows, Mac OS X, Linux
  ### Supported languages: C, C++
  ### 
  ### Authors: Olivier Michel - www.cyberbotics.com
  ### Revised: Yvan Bourquin - September 30th, 2009.
  ###
  ### Uncomment the variables to customize the Makefile
  
  ### -----C Sources-----
  ###
  ### if your plugin uses several C source files:
   C_SOURCES = my_contact_p_physics.c
  
  ### -----C++ Sources-----
  ###
  ### if your plugin uses several C++ source files:
  # CPP_SOURCES = my_plugin.cpp my_clever_algo.cpp my_graphics.cpp
  ###     or
  # CC_SOURCES = my_plugin.cc my_clever_algo.cc my_graphics.cc
  
  FRAMEWORK = -framework OpenGL -framework GLUT 
  
  ### -----Options-----
  ###
  ### if special CFLAGS are necessary, for example to set optimization level or
  ### to find include files:
  #CFLAGS=-O3 -I/System/Library/Frameworks/OpenGL.framework
  ###
  ### if your plugin needs additional libraries:
  LIBRARIES=-L/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries -llibGL -llibGLU
  
  
  ### Do not modify: this includes Webots global Makefile.include
  space :=
  space +=
  WEBOTS_HOME_PATH=$(subst $(space),\ ,$(strip $(subst \,/,$(WEBOTS_HOME))))
  include $(WEBOTS_HOME_PATH)/resources/projects/default/plugins/physics/Makefile.include
  </code></pre>
  
  <p><strong>P.S:</strong> In the "my_contact_p_physics.c" (the .c file I am trying so hard to compile) I simply include a ODE/ode.h file and the physics.h file with absolute path. I cannot compile directy in the terminal because of the ODE which "integrated" into webots, reason why I compile in webots directly.</p>