title: C++ for arduino - error: class does not name a type
body: <p>I'am expert in java but not in C and in C++. I'am trying to develop a C++ api for my Arduino projects.
  There are two classes in 4 separate files (headers .h and .cc files). The class <strong>CDScreen</strong> is a container of <strong>CDFrame</strong> objects.</p>
  
  <p>What i want to do now is to keep track of the parent container of the CDFrame entries. In other words, the CDFrame object need to know its container (parent).
  For that purpose i added a property called "parent" of type CDScreen into the CDFrame class.</p>
  
  <p>This addition in header of class CDFrame cause a complile error in header of class CDScreen ('CDFrame' does not name a type CDScreen.h). 
  Specifically, i notice that the problem is caused from the declaration of the CDScreen.h file at the top of the .h file of the CDFrame.
  The compilation seems that it stops at that point. </p>
  
  <p>What goes wrong here? How is it possible to create a class A with property of B which in turn has properties of A?
  Is this an issue or my developing way is totally in java-like fashion?</p>
  
  <p>the CDFrame.h file:</p>
  
  <pre><code>#include "CDScreen.h" //&lt;- this cause the problem
  #include &lt;stdint.h&gt;
  
  class CDFrame {
  public:
      CDFrame(uint8_t capacity);
      virtual ~CDFrame();
  
  private:
      uint8_t capacity = 0;
      CDScreen* parent = nullptr; //&lt;- Parent property of CDScreen class
  }
  </code></pre>
  
  <p>and the CDScreen.h file:</p>
  
  <pre><code>#include "CDFrame.h"
  #include &lt;stdint.h&gt;
  
  class CDScreen {
  public:
      CDScreen(uint8_t capacity);
      virtual ~CDScreen();
      void addFrame(CDFrame* frame); // Sets the frame's parent (this CDScreen) when a new frame is added 
  
  private:
      uint8_t capacity = 0;
      uint8_t size = 0;
      CDFrame** frames;   
  }
  </code></pre>