c++链接错误——分别编译没有错。可是链接了就有错误。
这是什么错误啊!我本来是一个头文件。其余的都是CPP文件。后来嫌乱,把头文件分开了。声明放还在头文件里。实现部分就重新建立了对应的cpp文件。可是就有很多错误了。就下面一种! 分别编译都没有错误。连起来就不行了。请高手们指点一二!!!不胜感激
main.obj : error LNK2001: unresolved external symbol "public: virtual __thiscall List<class student>::~List<class student>(void)" (??1?$List@Vstudent@@@@UAE@XZ)
main.obj : error LNK2001: unresolved external symbol "public: virtual __thiscall List<class Cworker>::~List<class Cworker>(void)" (??1?$List@VCworker@@@@UAE@XZ)
main.obj : error LNK2001: unresolved external symbol "public: class Node<class Cworker> * __thiscall List<class Cworker>::Find(class Cworker)" (?Find@?$List@VCworker@@@@QAEPAV?$Node@VCworker@@@@VCworker@@@Z)
main.obj : error LNK2001: unresolved external symbol "public: void __thiscall List<class Cworker>::PrintList(void)" (?PrintList@?$List@VCworker@@@@QAEXXZ)
main.obj : error LNK2001: unresolved external symbol "public: __thiscall List<class Cworker>::List<class Cworker>(void)" (??0?$List@VCworker@@@@QAE@XZ)
main.obj : error LNK2001: unresolved external symbol "public: void __thiscall List<class student>::MakeEmpty(void)" (?MakeEmpty@?$List@Vstudent@@@@QAEXXZ)
main.obj : error LNK2001: unresolved external symbol "public: class Node<class student> * __thiscall List<class student>::Find(class student)" (?Find@?$List@Vstudent@@@@QAEPAV?$Node@Vstudent@@@@Vstudent@@@Z)
main.obj : error LNK2001: unresolved external symbol "public: void __thiscall List<class student>::PrintList(void)" (?PrintList@?$List@Vstudent@@@@QAEXXZ)
main.obj : error LNK2001: unresolved external symbol "public: __thiscall List<class student>::List<class student>(void)" (??0?$List@Vstudent@@@@QAE@XZ)
main.obj : error LNK2001: unresolved external symbol "public: void __thiscall List<class student>::InsertRear(class Node<class student> *)" (?InsertRear@?$List@Vstudent@@@@QAEXPAV?$Node@Vstudent@@@@@Z)
main.obj : error LNK2001: unresolved external symbol "public: class Node<class student> * __thiscall List<class student>::CreatNode(class student)" (?CreatNode@?$List@Vstudent@@@@QAEPAV?$Node@Vstudent@@@@Vstudent@@@Z)
main.obj : error LNK2001: unresolved external symbol "public: void __thiscall List<class Cworker>::InsertRear(class Node<class Cworker> *)" (?InsertRear@?$List@VCworker@@@@QAEXPAV?$Node@VCworker@@@@@Z)
main.obj : error LNK2001: unresolved external symbol "public: class Node<class Cworker> * __thiscall List<class Cworker>::CreatNode(class Cworker)" (?CreatNode@?$List@VCworker@@@@QAEPAV?$Node@VCworker@@@@VCworker@@@Z)
Debug/kechengsheji.exe : fatal error LNK1120: 13 unresolved externals