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.
I'm trying to make a simple game, using SFML 2.0, my question is:
I have an enum, for example:
enum GameState
{
Menu,
Battle,
Map,
SubMenu,
Typing
};
So, I want to make a variable of that kind, using
GameState State = Menu;
And then, pass it to another file as
extern GameState State;
But I get error
error: 'GameState' does not name a type
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.