title: OpenGL C++ on Mac build fail 'GL/glut.h' file not found
body: <p>Attempting to run a sample OpenGL C++ program on OSX Yosemite with xCode.</p>
  
  <p>When running the program I get 'GL/glut.h' file not found screenshot:</p>
  
  <p><img src="https://i.stack.imgur.com/0AW7W.png" alt="&#39;GL/glut.h&#39; file not found"></p>
  
  <p>However, I do have the glut.h header in the project:</p>
  
  <p><img src="https://i.stack.imgur.com/EH2vL.png" alt="glut.h header in the project"></p>
  
  <p>On a separate forum I read that it should be 'GLUT/glut.h' so I did, but got the following message:</p>
  
  <p><img src="https://i.stack.imgur.com/2rkB0.png" alt="GLUT/glut.h"></p>
  
  <p>What do I need to do to have OpenGL with C++ configured?</p>
  
  <p>This is the code I am trying to run. If I can run this, then I should have everything ready to go:</p>
  
  <pre><code>#include &lt;GLUT/glut.h&gt;
  #include &lt;math.h&gt;
  //#include &lt;stdlib.h&gt;
  
  const double TWO_PI = 6.2831853;
  
  /*  Initial display-window size.  */
  GLsizei winWidth = 400, winHeight = 400;
  GLuint regHex;
  
  class screenPt
  {
  private:
      GLint x, y;
  
  public:
      /*  Default Constructor: initializes coordinate position to (0, 0).  */
      screenPt ( )  {
          x = y = 0;
      }
  
      void setCoords (GLint xCoord, GLint yCoord)  {
          x = xCoord;
          y = yCoord;
      }
  
      GLint getx ( ) const  {
          return x;
      }
  
      GLint gety ( ) const  {
          return y;
      }
  };
  
  static void init (void)
  {
      screenPt hexVertex, circCtr;
      GLdouble theta;
      GLint k;
  
      /*  Set circle center coordinates.  */
      circCtr.setCoords (winWidth / 2, winHeight / 2);
  
      glClearColor (1.0, 1.0, 1.0, 0.0);   //  Display-window color = white.
  
      /*  Set up a display list for a red regular hexagon.
       *  Vertices for the hexagon are six equally spaced
       *  points around the circumference of a circle.
       */
      regHex = glGenLists (1);   //  Get an identifier for the display list.
      glNewList (regHex, GL_COMPILE);
      glColor3f (1.0, 0.0, 0.0);   //  Set fill color for hexagon to red.
      glBegin (GL_POLYGON);
      for (k = 0; k &lt; 6; k++) {
          theta = TWO_PI * k / 6.0;
          hexVertex.setCoords (circCtr.getx ( ) + 150 * cos (theta),
                               circCtr.gety ( ) + 150 * sin (theta));
          glVertex2i (hexVertex.getx ( ), hexVertex.gety ( ));
      }
      glEnd ( );
      glEndList ( );
  }
  
  void regHexagon (void)
  {
      glClear (GL_COLOR_BUFFER_BIT);
  
      glCallList (regHex);
  
      glFlush ( );
  }
  
  void winReshapeFcn (int newWidth, int newHeight)
  {
      glMatrixMode (GL_PROJECTION);
      glLoadIdentity ( );
      gluOrtho2D (0.0, (GLdouble) newWidth, 0.0, (GLdouble) newHeight);
  
      glClear (GL_COLOR_BUFFER_BIT);
  }
  
  void main (int argc, char** argv)
  {
      glutInit (&amp;argc, argv);
      glutInitDisplayMode (GLUT_SINGLE | GLUT_RGB);
      glutInitWindowPosition (100, 100);
      glutInitWindowSize (winWidth, winHeight);
      glutCreateWindow ("Reshape-Function &amp; Display-List Example");
  
      init ( );
      glutDisplayFunc (regHexagon);
      glutReshapeFunc (winReshapeFcn);
  
      glutMainLoop ( );
  }
  </code></pre>