The message you are getting actually comes from the linker, not from the compiler.
One of your member functions, bool Tree::inTree(int index);
, is correctly declared and defined as a const
member function:
// Declaration in tree.h
bool inTree(int index) const;
// Definition in tree.cc
bool Tree::inTree(int k) const
// ^^^^^
However, in tree.h
you also define this non-const
overload of inTree()
:
// Declaration in tree.h, definition (supposedly) nowhere
bool Tree::inTree(int k)
For which no definition is provided. This is what the linker complains about.