Ok guys...
I have following class
#include
template >
class BinarySearchTree {
struct TNode {
TValue value;
TNode *pLeft;
TNode *pRight;
};
public:
BinarySearchTree();
~BinarySearchTree();
. . .
private:
TNode *pRoot;
. . .
};
then in my .cpp file i defined the ctor/dtor like this:
template
BinarySearchTree::BinarySearchTree() : pRoot(0) {}
template
BinarySearchTree::~BinarySearchTree() {
Flush(pRoot);
}
my main function:
int main() {
BinarySearchTree obj1;
return 0;
}
and i get following linkage error:
public: __thiscall BinarySearchTree>::BinarySearchTree >(void)
i tried to put the constructor definition into the header file and i get no error. only if i try to define it in the cpp file.
No comments:
Post a Comment