#include "math.h"
#include "iostream.h"
class Data
{
public:
float m_xLocation,m_yLocation,m_zLocation;
float m_Incangle,m_Refangle,m_Norangle;
};
template <class T>
class tnode
{
public:
T nodeValue;
tnode<T> *left,*right,*parent;
tnode();
tnode(const T& item,tnode<T> *lptr=NULL,tnode<T> *rptr=NULL,tnode<T> *pptr=NULL):
nodeValue(item),left(lptr),right(rptr),parent(pptr)
{}
};
void main()
{
tnode<Data> *save=new tnode<Data>[5];
}
程序如上,错误类型如下:
BinaryTree.obj : error LNK2001: unresolved external symbol "public: __thiscall tnode<class Data>::tnode<class Data>(void)" (??0?$tnode@VData@@@@QAE@XZ)
Debug/BinaryTree.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.
请问是什么原因产生这样的错误,如何改正?