0

I am recently working on a template linked list, however I have encounered a problem

    #ifndef _T_NODE_
#define _T_NODE_
using namespace std;

template<typename T>
class TNode{
public:
    TNode();
    TNode(T a);

    ~TNode();

private:
    T template_;
    TNode<T> *link_;
};

#endif

My implementation is:

template<typename T>
TNode<T>::TNode(){
    link_ = NULL;
    template_ = T();
}

template<typename T>
TNode<T>::TNode(T a){
    template_=a;
    link_ = NULL;
}

template<typename T>
TNode<T>::~TNode(){
    delete link_;
}

In another Class, I tried to referred it in a function as such:

TNode<Bike> * actPtr;
        actPtr = new TNode<Bike>(a);

I receive the following error:

error LNK2019: unresolved external symbol "public: __thiscall TNode<class Bike>::TNode<class Bike>(class Bike)"  referenced in function "public: void __thiscall
user288231
  • 995
  • 2
  • 13
  • 24

0 Answers0