I've recently decided to make the move from Java to C++ I thought I would make a simple text-based game to get used to the language. Now I have declared my variables in my header file, but I'm unable to use them and am getting the Following "Error 14 error C2065: '....' : undeclared identifier
" for all of my variables.
In Entity.cpp you define many functions which have no relation to your Entity class. You need to use the scope resolution operator to let the compiler know you are implementing the functions from the scope of your class:
6 7 8
voidEntity::setName(string text){
name = text;
}
Note that C++ also supports inline class definition with similar syntax to Java.