请帮忙解决下error LNK2001: unresolved external symbol
编译可以通过。连接时出现error LNK2001: unresolved external symbol错误
Linking...
main.obj : error LNK2001: unresolved external symbol "public: __thiscall SeqList<int>::~SeqList<int>(void)" (??1?$SeqList@H@@QAE@XZ)
main.obj : error LNK2001: unresolved external symbol "public: __thiscall SeqList<int>::SeqList<int>(void)" (??0?$SeqList@H@@QAE@XZ)
Debug/SL.exe : fatal error LNK1120: 2 unresolved externals
Error executing link.exe.
/* main.cpp*/
#include "SeqList.h"
#include <iostream>
using namespace std;
int main()
{
cout<<"start"<<endl;
SeqList<int> s;
return 1;
}
/* SeqList.h*/
#include "LinearList.h"
const int defaultSize=100;
template <class T>
class SeqList:public LinearList<T>{
protected:
T* data;
int maxSize;
int last;
void reSize(int newSize);
public:
SeqList();
SeqList(int sz);
SeqList(const SeqList<T>& L);
~SeqList();
int Size()const;
int Length()const;
int Search(const T& X)const;
T getData(int i)const;
void setData(int i,const T& x);
bool Insert(int i,T& x);
bool Remove(int i,T& x);
bool IsEmpty()const;
bool IsFull()const;
void input();
void output();
SeqList<T> operator=(const LinearList<T>& L);
};
函数的实现:
template <class T>
SeqList<T>::SeqList()
{
cout<<"called!"<<endl;
maxSize=0;
last=-1;
data=new T[defaultSize];
}
template <class T>
SeqList<T>::~SeqList()
{
delete[] data;
}
请帮忙看看问题在哪多谢了。