title: error: 'object' was not declared in this scope
body: <p>I am pretty new at c++ and trying to make Monopoly game. Unfortunately it still shows me error in declaration between two classes.
  I've already tried everything and really have no idea where the problem can be.</p>
  
  <p>The error: 'Player' is not declared in this scope. </p>
  
  <h2>Engine.h</h2>
  
  <pre><code>#ifndef ENGINE_H
  #define ENGINE_H
  #include "Player.h"
  #include &lt;vector&gt;
  using namespace std;
  class Engine{
  public:
      Engine(); // method that starts with game, take random number for getting number of players, set players to vector
      void play(); // method where players are playing.
      bool returnBalance(int a_money) const; // method that return True, if the players has still some amount on account, False otherwise
      bool isWinner();
      int setBalance(); // method that set curretn player amount
      void printWinner(); // method that print winter of the game
      void payBills(int amount); // player pay any bills with this method
      virtual ~Engine();
  private:
      vector&lt;Player*&gt; players;
      int i_player;
      int balance;
      int currentPlayer;
  };
  #endif /* ENGINE_H */
  </code></pre>
  
  <h2>Engine.cpp</h2>
  
  <pre><code>#include "Engine.h"
  #include &lt;iostream&gt;
  #include &lt;stdlib.h&gt;
  using namespace std;
  
  Engine::Engine() {
      int numPlayers = rand()*(6-2)+2;
      for (int i = 0; i &lt;= numPlayers; i++){
          Player* p = new Player;
          players.push_back(p);
      }
       cout &lt;&lt; players.size() &lt;&lt; endl; 
  
      int p_index = 0; 
       for(int i = 1; i &lt;= players.size(); i++){
           p_index = i;
           p_index++;
           cout &lt;&lt; p_index ;
       }
      currentPlayer = p_index;     
  
      cout &lt;&lt; "Welcome to MonOOpoly game, the game will be played in the same order you already are." &lt;&lt; endl;
  }
  
  void Engine::play() {
      do{
  
      }while(!isWinner());
  }
  
  bool Engine::isWinner(){
      int count = 0;
      for(int i = 1; i &lt;= players.size(); i++){
          if(players[i]-&gt;getAmount() &gt; 0)
              count++; 
      }
      if(count &lt;= 1)
          return true;
      return false;
  
  }
  
  int Engine::setBalance(){
      int amount = players[currentPlayer]-&gt;amount;
      return players[currentPlayer]-&gt;amount;
  }
  
  bool Engine::returnBalance(int a_money) const{
      if (players[currentPlayer]-&gt;amount &lt; a_money)
          return false;
      else 
          return true;
  }
  
  void Engine::payBills(int amount) {
      players[currentPlayer]-&gt;amount = players[currentPlayer]-&gt;amount - amount;
  }
  
  void Engine::printWinner() {
      int winner = 0;
      int newWinner = 0;
      for(int i = 1; i &lt;= players.size(); i++){
          if(players[i] &gt; 0){
              winner = players[i]-&gt;getAmount();
              if(newWinner &lt; winner)
                  newWinner = winner;
          }
      }
      cout &lt;&lt; "Winner of the game MonOOpoly is: " &lt;&lt; newWinner &lt;&lt; endl;
  }
  
  Engine::~Engine() {
  }
  </code></pre>
  
  <h2>Player.h</h2>
  
  <pre><code>#ifndef PLAYER_H
  #define PLAYER_H
  #include "Engine.h"
  #include &lt;string&gt;
  using namespace std;
  
  class Player {
      friend class Engine;
  public:
      Player(); // constructor
      int getAmount() const; // return how much of amount the player has yet
      void setAmount(int a); // set amount
      int getPosition() const; // return position of the player
      void setPosition(int p); // to set position
      virtual ~Player(); // destructor
  private:
      int position; // the position of the player
      int amount; // the total amount
  };
  
  
  #endif /* PLAYER_H */
  </code></pre>
  
  <h2>Player.cpp</h2>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;stdlib.h&gt;
  #include "Player.h"
  using namespace std;
  
  Player::Player() {
      amount = 5000;
      position = 0;
  }
  
  int Player::getAmount() const {
      return amount;
  }
  
  void Player::setAmount(int a) {
      amount = a;
  }
  
  int Player::getPosition() const {
      return position;
  }
  
  void Player::setPosition(int p) {
      position = p;
  }
  
  Player::~Player() {
  }
  </code></pre>