Whenever you create any kind of object (including pointers) in C++, the full type of the object must be known. There is no such type in your code as Node, so you can't create instances of pointers to it. You need to rethink how you are designing and writing your code.