首页 > > > 类模板 无法解析的外部命令
#include "stdafx.h"
using namespace std;
template <class Type>
class Queue
{
public:
Queue();
Type& front();
const Type& front() const;
void push(const Type&);
void pop();
bool empty() const;
private:
//...
};
int _tmain(int argc, _TCHAR* argv[])
{
Queue<int> qi;
Queue< vector<double> > qc;
Queue<string> qs;
getchar();
return 0;
}error LNK2019: 无法解析的外部符号 "public: __cdecl Queue<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > >::Queue<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > >(void)" (??0?$Queue@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@@QEAA@XZ),该符号在函数 wmain 中被引用
error LNK2019: 无法解析的外部符号 "public: __cdecl Queue
error LNK2019: 无法解析的外部符号 "public: __cdecl Queue
什么问题???
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/4605/viewspace-3163020/ ,如需转载,请注明出处,否则将追究法律责任。