Passing an enum to another file? C++
<p>first time posting here, I'm a beginner in C++ programming, learning it mostly because I want to know it because it was always interesting, as how does this work, etc.<br>
I'm trying to make a simple game, using SFML 2.0, my question is:<br>
I have an enum, for example:<br></p>

<pre><code>    enum GameState
    {
        Menu,
        Battle,
        Map,
        SubMenu,
        Typing
    };
</code></pre>

<p>So, I want to make a variable of that kind, using</p>

<pre><code>    GameState State = Menu;
</code></pre>

<p>And then, pass it to another file as</p>

<pre><code>    extern GameState State;
</code></pre>

<p>But I get error</p>

<pre><code>    error: 'GameState' does not name a type
</code></pre>

<p>How to pass an enum to another file? I'm trying to do it by making it as a global variable in main.cpp and then including it in header of another file.</p>
