title: C++ '<class name> has not been declared' and '<class name> has no field <field name>' errors
body: <p>I'm doing an assignment for class and I'm getting weird compile errors. </p>
  
  <p>The errors are saying <code>error: 'Noble' has not been declared</code> and <code>error: class 'Warrior' does not have any field named 'pBoss'</code>. </p>
  
  <p>I'm new to C++ so I really don't get what I'm doing wrong here - it seems like I declared both classes and all the member fields.</p>
  
  <pre><code>#include &lt;vector&gt;
  #include &lt;iostream&gt;
  #include &lt;ostream&gt;
  using namespace std;
  
  class Warrior {
  public:
      Warrior(string name, double str) : name(name), strength(str), pBoss(nullptr) {}
      bool hire(Noble* noble) { }
      bool fire(Noble* noble) { }
      void lost() { }
      void won(double damageRatio) { }
      string getName() const { return name; }
      double getStrength() const { return strength; }
      Noble* getBoss() const { return pBoss; }
      void display(ostream&amp; os = cout) const { }
  private:
      string name;
      double strength;
      Noble* pBoss;
  };
  
  class Noble {
  public:
      Noble(string name) : name(name), alive(true) {}
      bool hire(Warrior&amp; war) { }
      bool fire(Warrior&amp; war) { }
      bool battle(Noble&amp; enemy) { }
      void display(ostream&amp; os = cout) const { }
  private:
      vector&lt;Warrior*&gt; army;
      string name;
      double strength;
      bool alive; 
      void lost() { } 
      void won(double damage) { }
  };
  </code></pre>
  
  <p>I took out the function descriptions so this won't be too long, but let me know if there is anything I didn't include and I'll update the post!</p>