Write a C + + project with vs2005, define the Alist class, write a class definition in AList.h, 3 functions that are not inline, and definitions written in AList.cpp. But each time the project is compiled, the 3 functions will not be correct.
DataStruct.obj:error lnk2001:unresolved external symbol "public:virtual bool __thiscall alist<int>::insert (int c Onst &) "(insert@ $AList @h@ @UAE_NABH @z)
DataStruct.obj:error lnk2001:unresolved external symbol "public:virtual bool __thiscall alist<int>::append (int c Onst &) "(append@ $AList @h@ @UAE_NABH @z)
DataStruct.obj:error lnk2001:unresolved external symbol "public:virtual bool __thiscall alist<int>::remove (int & amp;) " (remove@ $AList @h@ @UAE_NAAH @z)
To resolve this error:
1, using the template, class definitions and function implementations are to be in the same file.
2, may include "AList.cpp", but do not know whether there is a negative impact on the project.