Im writing a basic program for an animal guessing game (similar to twenty questions) using a binary search tree. The project consists of a lot of header files, so things are bound to get messy. But this is one error I haven't been able to figure out.Code:Error: [Linker error] undefined reference to `Node<QA>::Node(QA)'
Here's the function I've narrowed the problem down to:
...And the seperate .cpp file for the Node class (it's friended to QATree).Code:bool QATree::insert(string o, bool q) { Node<QA>* newnode = new Node<QA>(QA(o,q)); // this constructor function call causes the error. if (!root) { root = newnode; return true; } if (insert(root, newnode)); return true; }
If you have any questions, or can't see the error here and would like to see more code, I'll be glad to help you help me.Code:#include "bsttools.h" template <typename T> Node<T>::Node(T s) { data = s; left = NULL; right = NULL; }