First published here, I'm new to C ++ programming, learning it mainly because I want to know it, because it was always interesting how it works, etc.
I am trying to make a simple game using SFML 2.0, my question is:
I have an enumeration, for example:
enum GameState { Menu, Battle, Map, SubMenu, Typing };
So, I want to make such a variable using
GameState State = Menu;
And then transfer it to another file as
extern GameState State;
But I get an error
error: 'GameState' does not name a type
How to transfer enumeration to another file? I am trying to do this by making it a global variable in main.cpp and then including it in the header of another file.
source share