title: Enum in header files
body: <p>I have enum declared in a header file called "sm.h"</p>
  
  <pre><code>enum GameStates
  {
    STATE_NULL = 0,
    STATE_INTRO,
    STATE_TITLE,
    STATE_MAIN,
    STATE_EXIT
  };
  </code></pre>
  
  <p>All it does is list the possible game states</p>
  
  <p>However in the following line in "base.cpp":</p>
  
  <pre><code>stateID = STATE_INTRO;
  </code></pre>
  
  <p>The compiler says "STATE_INTRO was not declared in this scope". I have no idea what I am doing wrong. I know that I have included the header file right and I can go to its deceleration from the .cpp file. So why am I getting this error.</p>
  
  <pre><code>stateID = STATE_INTRO;
  </code></pre>
  
  <p>Is used in:</p>
  
  <pre><code>bool baseFunctions::load_rc()
  {
   stateID = STATE_INTRO;
  
   currentState = new Intro();
  
   return true;
  }
  </code></pre>
  
  <p>which defines a class function in a header file.</p>
  
  <p>There are no global conflicts because it is the only enum in the whole program</p>