title: Class "classname" has no member "function"
body: <p>So I have a school project where I have to make a random dungeon crawler. I am quite new to C++ and I have an error, I know what the problem is but I don't know how to solve it exactly.</p>
  
  <p>Here is the thing:</p>
  
  <p>In my Chamber class I want a pointer to the DungeonLayer class. But I can't include DungeonLayer.h to Chamber.h because DungeonLayer.h already has Chamber.h included so I get an exception.</p>
  
  <p><strong>How can I make it so DungeonLayer class is accessable from the Chamber class?</strong></p>
  
  <p>Files:</p>
  
  <p>DungeonLayer.h</p>
  
  <pre><code>#pragma once
  #include &lt;vector&gt;
  #include "Chamber.h"
  
  class DungeonLayer {
  
  public:
      DungeonLayer(std::string text, int l);
      Chamber findChamber(int x2, int y2);
      std::vector&lt;Chamber&gt; chambers;
      void generateDungeonLayer();
      bool chamberExists(int x2, int y2);
  };
  </code></pre>
  
  <p>Chamber.h</p>
  
  <pre><code>#pragma once
  #include &lt;vector&gt;
  #include "Enemy.h"
  #include "Hero.h"
  
  class DungeonLayer {
  
  };
  
  class Chamber {
  
  public:
      Chamber(std::vector&lt;Chamber&gt;* dungeonLayer, int ammountOfChambers);
      DungeonLayer *layer;
      Chamber *nextChamber;
      .......
      Chamber* Chamber::getNextChamber();
      void moveToChamber();
  
  private:
      bool visited;
  };
  </code></pre>
  
  <p>Whenever I set the pointer of the DungeonLayer (layer) and I want to call a function on it it gives the error: </p>
  
  <p>Example</p>
  
  <pre><code>layer-&gt;findChamber(0,0);
  </code></pre>
  
  <p>Error:</p>
  
  <pre><code>"class "DungeonLayer" has no member "findChamber"   CPPAssessment   Chamber.cpp"
  </code></pre>
  
  <p>This is obvious because the class DungeonLayer in Chamber.h has nothing in it. But how can I make it so DungeonLayer is accessable from Chamber?</p>