error: expected class-name before ‘{’ token

前端 未结 5 705
独厮守ぢ
独厮守ぢ 2020-11-30 05:41

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

5条回答
  •  半阙折子戏
    2020-11-30 06:15

    Replace

    #include "Landing.h"
    

    with

    class Landing;
    

    If you still get errors, also post Item.h, Flight.h and common.h

    EDIT: In response to comment.

    You will need to e.g. #include "Landing.h" from Event.cpp in order to actually use the class. You just cannot include it from Event.h

提交回复
热议问题