error: Invalid use of incomplete type
问题 I got the following problem, does anyone have a good idea? class Vector_2d; namespace Utils { class Align_vector : public Vector_2d { protected: bool check_range(int x, int y); public: enum alignment {left, right, up, down}; Align_vector(Alignment alignment); void set_alignment(Alignment alignment); Alignment get_alignment(); }; } the error is: error: invalid use of incomplete type ‘class Vector_2d’ But how is there an error? 回答1: class Vector_2d; This only declares a class by that name exits