compiler cannot recognize my class in c++ – cyclic dependency

As i said in the comment, the problem is due to cyclic dependency. In particular, your Student.hpp includes –> Grad.hpp which in turn includes –> Core.hpp which finally includes –> Student.hpp So as you can see from above, you ended up where you started, namely at Student.hpp. This is why it is called cyclic dependency. … Read more

Cyclic dependency between header files

In the headers, forward declare the member functions: class Node { Tree * tree_; int id_; public: Node(Tree * tree, int id); ~Node(); void hi(); }; In a separate .cpp file that includes all the required headers, define them: #include “Tree.h” #include “Node.h” Node::Node(Tree * tree, int id) : tree_(tree), id_(id) { tree_->incCnt(); } Node::~Node() … Read more