The information in this article applies to:
SYMPTOMSYou receive a LNK2001 error message on template member functions unless the member functions are also defined in the same translation unit. CAUSEThe compiler does not support the use of the "export" keyword as specified in the C++ standard below:
RESOLUTIONYou have the following two options:
MORE INFORMATION
Explicit instantiation allows you to create an instantiation of a template class or function without actually using it in your code. The idea is to explicitly instantiate all possible types for the template class in the implementation file. Thus, when the .cpp file is compiled, the code is generated for these instantiations, alleviating the LNK2001 error. REFERENCESFor additional information, click the article number below to view the article in the Microsoft Knowledge Base: Q128789 BUG: LNK2001 on Member Function When Use Nested Class Template Additional query words:
Keywords : kbLangCPP kbLinker kbVC kbVC500 kbVC600 kbDSupport |
Last Reviewed: September 30, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |