Fatal error Lnk1120:3 unresolved externals fault handling

Source: Internet
Author: User
Tags class definition

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.