Template Class error lnk2019: external symbols that cannot be parsed

Source: Internet
Author: User

If an error occurs during template class Compilation: "error lnk2019: external symbols that cannot be parsed...", there are two solutions:

The first method is to include both the Declaration file (interface file )(. h file). It also contains the implementation file of the class template (. CPP file.

The second method is to place the Declaration and definition of the member functions in the class template in the class definition (. h file). Do not separate them.

Post: http://blog.csdn.net/rbagglo/article/details/5803291

Supplement:

C ++ npv2 can see the following practices, directly introduce the template file in the header file:

#if defined (ACE_TEMPLATES_REQUIRE_SOURCE)#include "Reactor_Logging_Server_T.cpp"#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */

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.