title: C++ Making Pointer of Class type
body: <p>I'm new to C++ and can't figure out this error. </p>
  
  <p>I'm trying to make a pointer type for the class <code>Player</code>. From all of the tutorials I've seen, this should be the proper syntax for declaring a pointer of type <code>Player</code> in a header file.</p>
  
  <pre><code>Player* player = new Player;
  </code></pre>
  
  <p>[EDIT, accidentally posted before finished]</p>
  
  <p>But I get the error " must use 'class' tag to refer to type 'Player' in this scope". I've used <code>#include "Player.h"</code>.</p>
  
  <p>What's going on here?</p>
  
  <p>EDIT
  All of these give the same error</p>
  
  <pre><code>    Player* player;
      Player* player = new Player;
      Player* player = new Player();
  </code></pre>
  
  <p>This header file for <code>Player</code></p>
  
  <pre><code>#ifndef PLAYER_H
  #define PLAYER_H
  
  #include &lt;vector&gt;
  #include &lt;string&gt;
  #include &lt;iostream&gt;
  
  #include "Item.h"
  #include "GlobalDefs.h"
  
  class Player
  { 
  
  public:
  
      // constructor
      Player( void );
  
      // destructor
      virtual ~Player( void );
  
  
      inline gold_t GetGold( void ) 
      {
          return gold;
      }
  
      void AddGold(gold_t amount);
      void RemoveGold(gold_t amount);
      std::string GetInventoryString(void);
      void AddItem(Item);
  
  private:
      gold_t gold;
      Item item;
      std::vector &lt;Item&gt; inventory;
  
  };
  
  #endif  /* PLAYER_H */
  </code></pre>
  
  <p>This is the header file where the pointer (<code>Player* player = new Player;</code>) is being defined.</p>
  
  <pre><code>#ifndef STOREAREA_H
  #define STOREAREA_H
  
  #include "AreaAbstract.h"
  #include "Player.h"
  #include &lt;iostream&gt;
  
  class StoreArea : public AreaAbstract{
       typedef void (StoreArea::*AreaInput)( void );
  
  public:
      StoreArea(*Player);
      StoreArea();
  
      ~StoreArea();
  
      void PrintAreaText();
      bool RecieveInput(std::string);
  
  
  protected:
      void PurchaseHelm();
      std::map &lt;std::string, AreaInput&gt; areaInputMap;
  
      Player* player;
  
  
  };
  
  #endif  /* STOREAREA_H */
  </code></pre>