title: error: expected class-name before ‘{’ token
body: <p>I know there are a couple of similar questions(circular include) out stackoverflow and other websites. But I still can't figure it out and no solutions pop out. So I would like to post my specific one.</p>
  
  <p>I have a Event class who has 2 and actually more subclass, which are Arrival and Landing. The compiler(g++) complains:</p>
  
  <pre><code>g++ -c -Wall -g -DDEBUG Event.cpp -o Event.o
  In file included from Event.h:15,
                   from Event.cpp:8:
  Landing.h:13: error: expected class-name before ‘{’ token
  make: *** [Event.o] Error 1
  </code></pre>
  
  <p>People said that it's a circular include. The 3 header files(Event.h Arrival.h Landing.h) are as follows:</p>
  
  <p>the Event.h:</p>
  
  <pre><code>#ifndef EVENT_H_
  #define EVENT_H_
  
  #include "common.h"
  #include "Item.h"
  #include "Flight.h"
  
  #include "Landing.h"
  
  class Arrival;
  
  class Event : public Item {
  public:
      Event(Flight* flight, int time);
      virtual ~Event();
  
      virtual void occur() = 0;
      virtual string extraInfo() = 0; // extra info for each concrete event
  
      // @implement
      int compareTo(Comparable* b);
      void print();
  
  protected:
      /************** this is why I wanna include Landing.h *******************/
      Landing* createNewLanding(Arrival* arrival); // return a Landing obj based on arrival's info
  
  private:
      Flight* flight;
      int time; // when this event occurs
  
  };
  
  #endif /* EVENT_H_ */
  </code></pre>
  
  <p>Arrival.h:</p>
  
  <pre><code>#ifndef ARRIVAL_H_
  #define ARRIVAL_H_
  
  #include "Event.h"
  
  class Arrival: public Event {
  public:
      Arrival(Flight* flight, int time);
      virtual ~Arrival();
  
      void occur();
      string extraInfo();
  };
  
  #endif /* ARRIVAL_H_ */
  </code></pre>
  
  <p>Landing.h</p>
  
  <pre><code>#ifndef LANDING_H_
  #define LANDING_H_
  
  #include "Event.h"
  
  class Landing: public Event {/************** g++ complains here ****************/
  public:
      static const int PERMISSION_TIME;
  
      Landing(Flight* flight, int time);
      virtual ~Landing();
  
      void occur();
      string extraInfo();
  };
  
  #endif /* LANDING_H_ */
  </code></pre>
  
  <p>UPDATE:</p>
  
  <p>I included Landing.h due to Landing's constructor is called in the Event::createNewLanding method:</p>
  
  <pre><code>Landing* Event::createNewLanding(Arrival* arrival) {
      return new Landing(flight, time + Landing::PERMISSION_TIME);
  }
  </code></pre>