########################GOBJ/GObj.h################## #ifndef _GOBJ_ #define _GOBJ_ namespace GRAV { class GObj { public: GObj(); virtual ~GObj(); protected: private: }; } #endif // _GOBJ_ ################################################################## ############################GObj/GObj.cpp######################## #include "GObj.h" namespace GRAV { GObj::GObj() { //ctor } GObj::~GObj() { //dtor } } ################################################################# ########################GConsole/GConsole.h##################### #ifndef _GCONSOLE_ #define _GCONSOLE_ #include #include #include #include "../GLog/GLog.h" #include "../GObj/GObj.h" namespace GRAV { class GConsole { public: GConsole (GRAV::GLog& log, const std::string& welcome = ""); virtual ~GConsole(); /******************** * Return code definitions: * 0: normal exit * -1: not understable stuff *******************/ int GMainLoop (void); private: int TestCommand (std::string& command); GRAV::GLog& myLog; std::map myUniverse; std::string mySaveCommand; }; } #endif // _GCONSOLE_ ############################################################# #################GConsole/GConsole.cpp####################### #include "GConsole.h" using namespace std; namespace GRAV { int GConsole::TestCommand (string& command) { //Extract all the command and argument string Mcommand = command + " "; vector Arg; while (Mcommand.find (" ") != string::npos) { //cout << "Test !" << endl; Arg.push_back (Mcommand.substr (0, Mcommand.find (" ") ) ); Mcommand = Mcommand.substr (Mcommand.find (" ") + 1, Mcommand.size() ); } //Mhhhh... I just love If ! if (Arg[0] == "test") this->myLog.GLogg ("It's just a sample test. It should be deleted further.\n"); else if (Arg[0] == "new") { if(Arg[1] == "SolarSystem") /****************** * The error is here: *****************/ //myUniverse[Arg[2]] = Gobj(); GObj test; myUniverse[Arg[2]] = test; }else if (Arg[0] == "set") { //change some stuff }else if (Arg[0] == "del") { //delete some stuff }else if (Arg[0] == "draw") { //draw some stuff }else if (Arg[0] == "exit") { return 0; //just exit }else if (Arg[0] == "show") { //show some stuff }else if(Arg[0] == "save") { //save all the stuff }else if(Arg[0] == "reset") { this->mySaveCommand = ""; }else //not-understable stuff { return -1; } return 1; //Ugly stuff hihihihi } } ############################################################# ############################################################# ######################COMPILER ERROR:####################### GConsole/GConsole.cpp:62: error: ‘test’ was not declared in this scope :: === Build finished: 1 errors, 0 warnings ===