error LNK2019: 无法解析的外部符号 "public: void __thiscall
我在头文件中声明:
template < class T >
class list {
......
void del ( node <T> *target ) ;
......
在源文件中实现如下:
template < class T >
void list < T > :: del ( node<T> *target ) { ......
为什么会 “error LNK2019: 无法解析的外部符号 "public: void __thiscall list<int>::del(struct node<int> *)" (?del@?$list@H@@QAEXPAU?$node@H@@@Z),该符号在函数 "public: int __thiscall stack<int>::pop(void)" (?pop@?$stack@H@@QAEHXZ) 中被引用” ?
而只要我把函数定义内联到类定义内部就不会出错?
编译器:VS2008