title: Accessing type from a namespace in header file
body: <p>There seems to be something wrong with accessing namespaces in header files. The best way to explain this is by example:</p>
  
  <hr>
  
  <p>I'm getting a compiler error for doing this:</p>
  
  <p>Game.h:</p>
  
  <pre><code>#pragma once
  
  struct Game
  {
  //some other stuff here
  private:
      glm::mat4 projection;
  };
  </code></pre>
  
  <p>Game.cpp:</p>
  
  <pre><code>#include &lt;glm/glm.hpp&gt;
  #include &lt;glm/gtc/matrix_transform.hpp&gt;
  
  #include "Game.h"
  </code></pre>
  
  <p>Here's the error:</p>
  
  <pre><code>'glm' is not a class or namespace name
  'projection': unknown override specifier
  missing type specifier - int assumed. Note: C++ does not support default-int
  </code></pre>
  
  <hr>
  
  <p>However, doing this is fine:</p>
  
  <p>Game.h:</p>
  
  <pre><code>#pragma once
  
  struct Game
  {
  //some other stuff here
  };
  </code></pre>
  
  <p>Game.cpp:</p>
  
  <pre><code>#include &lt;glm/glm.hpp&gt;
  #include &lt;glm/gtc/matrix_transform.hpp&gt;
  
  #include "Game.h"
  
  glm::mat4 projection;
  </code></pre>
  
  <p>What I'm stumped by is the fact that the namespace can't be found inside the header file although it works on the cpp file.</p>
  
  <p>Visual Studio recognizes that the namespace exists (no underline in editor) but when I compile it suddenly doesn't exist.</p>