title: Double include solution?
body: <p>In C++, I have a problem with a double include:</p>
  
  <p>File stuffcollection.h</p>
  
  <pre><code>#pragma once
  #ifndef STUFFCOLLECTION_H
  #define STUFFCOLLECTION_H
  
  #include "Stage.h"
  
  class Stuffcollection {
      public:
          bool myfunc( Stage * stage );
  };
  
  #endif // STUFFCOLLECTION_H
  </code></pre>
  
  <p>File stage.h:</p>
  
  <pre><code>#pragma once
  #ifndef STAGE_H
  #define STAGE_H
  
  #include "Stuffcollection.h"
  
  class Stage {
      // stuffcollection used in stage.cpp
  };
  
  #endif // STAGE_H
  </code></pre>
  
  <p>Compiler Error:</p>
  
  <p><code>\Stuffcollection.h|(line were bool myfunc is declared)|error: 'Stage' has not been declared|
  ||=== Build finished: 1 errors, 0 warnings ===|</code></p>
  
  <p>Can someone please explain why this happens and how it can be solved? I already use include guards and the pragma once preprocessor directive and it just doesn't work.</p>
  
  <p>(If I remove <code>#include "Stuffcollection.h"</code> from stage.h and comment out the respective lines that are using it in stage.cpp, the rest of my code works fine.  It's really just when including Stuffcollection into stage that it suddenly stops working.)</p>
  
  <p><em>PS: stage is just one example, I use stuffcollection in almost every other file too, and everytime I get this problem.</em></p>
  
  <p><strong>EDIT</strong>: I followed what has been suggested, and now the problem is <code>invalid use of incomplete type</code>, i.e. while the answers given solve the problem of the circular dependency they do not solve the problem I am dealing with. My problem is continued in <a href="https://stackoverflow.com/questions/7666665/circular-dependencies-incomplete-types">Circular Dependencies / Incomplete Types</a>. </p>
  
  <p><strong>EDIT</strong>: Both solved now.</p>