title: C++ OpenGL: Error gl.h included before glew.h
body: <p>I'm currently trying to write a little game with OpenGL. I got 2 classes:</p>
  
  <ul>
  <li>CoreEngine: for managing the Window, rendering, updating and so on</li>
  <li>Mesh:       for creating and managing meshes</li>
  </ul>
  
  <p>Includes from CoreEngine.h:</p>
  
  <pre><code>#define GLEW_STATIC
  #include &lt;GL/glew.h&gt;
  #include &lt;GLFW/glfw3.h&gt;
  #include &lt;vector&gt;
  
  #include "RenderingEngine.h"
  #include "GameObject.h"
  </code></pre>
  
  <p>Includes from Mesh.h:</p>
  
  <pre><code>#ifndef _MESH_H_
  #define _MESH_H_
  #define GLEW_STATIC
  #include &lt;GL/glew.h&gt;
  #include &lt;GLFW/glfw3.h&gt;
  
  #include &lt;string&gt;
  </code></pre>
  
  <p>The reason is that I need functions from OpenGL in CoreEngine.h and in Mesh.h, but when I try to compile I get this error:</p>
  
  <pre><code>Fehler  1   error C1189: #error :  gl.h included before glew.h
  </code></pre>
  
  <p>I can't find a way, to prevent this error and to have OpenGL functions in both classes at the same time.</p>