title: Invalid use of incomplete type with with 2 related classes
body: <p>My code has 2 related classes:<br><code>Class1</code> has pointer field to instance of <code>Class2</code>;<br><code>Class2</code> has pointer field to instance of <code>Class1</code>:</p>
  
  <p><strong>class1.hpp</strong></p>
  
  <pre><code>#ifndef __CLASS_1_HPP
  #define __CLASS_1_HPP
  
  #include "all.hpp"
  
  class Class1
  {
  public:
      Class1();
  private:
      Class2 *c2;
  };
  
  Class1::Class1() 
  {
      c2 = new Class2();
  }
  
  #endif // __CLASS_1_HPP
  </code></pre>
  
  <p><strong>class2.hpp</strong></p>
  
  <pre><code>#ifndef __CLASS_2_HPP
  #define __CLASS_2_HPP
  
  #include "all.hpp"
  
  class Class2
  {
  public:
      Class2();
  private:
      Class1 *c1;
  };
  
  Class2::Class2() 
  {
      c1 = new Class1();
  }
  
  #endif // __CLASS_2_HPP
  </code></pre>
  
  <p><strong>all.hpp</strong></p>
  
  <pre><code>#ifndef __ALL_HPP
  #define __ALL_HPP
  
  class Class1;
  class Class2;
  #include "class1.hpp"
  #include "class2.hpp"
  
  #endif // __ALL_HPP
  </code></pre>
  
  <p><strong>main.cpp</strong></p>
  
  <pre><code>#include "all.hpp"
  int main() {}
  </code></pre>
  
  <p>When I'm trying to compile this I get <strong>Invalid use of incomplete type Class2</strong> on line <code>c2 = new Class2();</code>. Division .hpp files on .hpp and .cpp does not help!</p>