C + + compilation error 2001 1120

Source: Internet
Author: User
Tags class definition configuration settings naming convention knowledge base

unresolved external symbol "symbol" code references content (such as functions, variables, or labels) that the linker cannot find in the library and object files. The error message is followed by error LNK1120. Possible cause: When you upgrade a managed library or WEB service project from Visual C + + 2003 to Visual C + + 2005, the/ZL compiler option is added to the Command line property page. This will lead to LNK2001. Please remove/zl from the Command line property page to resolve this issue. For more information, see/ZL (omitting the default library name) and how to: Open the Project Properties page. Alternatively, add msvcrt.lib and msvcmrt.lib to the linker's additional dependencies property. The content requested by the code does not exist (for example, a symbolic spelling error or using the wrong case). The content of the code request is wrong (using a mixed version of the library, some libraries come from one version of the product, others are from another version). Specific reason code issues if the LNK2001 diagnostic text report __check_commonlanguageruntime_version is an unresolved external symbol, see LNK2019 For information about how to resolve the problem. The definition of a member template is beyond the scope of the class. One limitation of Visual C + + is that the definition of a member template must reside entirely within a enclosing class. For more information about LNK2001 and member templates, see Knowledge Base article Q239436. A case mismatch in a code or module definition (. def) file can cause LNK2001. For example, when a variable is named var1 in a C + + source file, and you try to access the variable as VAR1 in another source file. If the project uses a function inline, but the function is defined in a. cpp file instead of a header file, it causes LNK2001. Calling C functions from a C + + program without using extern "C" (which causes the compiler to use the C naming convention) causes LNK2001. Compiler options/TP and/TC cause the compiler to compile files separately into C + + or C, regardless of the file name extension. These options cause the function name to be different from the name you expect. Attempting to reference a function or data that has no external linkage can cause LNK2001. In C + +, inline functions and const data have internal links unless explicitly specified as extern. Missing function principals or variables can cause LNK2001. If there is only a function prototype or extern declaration, the compiler continues to run without any errors, but the linker will not be able to resolve address calls or variable references because there is no reserved function code or variable space. The invocation parameter type does not match the type of the parameter in the function declarationfunction will cause LNK2001. The name decoration merges the function parameters into the final decorated function name. An error contains a prototype that causes the compiler to need a function body that is not provided, which results in LNK2001. If you have both class implementations and non-class implementations of function F, be aware of C + + scope resolution rules. When using C + +, a function prototype is included in the class definition but fails to contain the implementation (the implementation of this function of the class) causes LNK2001. Attempting to call a pure virtual function from a constructor or destructor of an abstract base class causes LNK2001. Pure virtual functions do not have a base class implementation. Attempting to use a variable (local variable) declared with the function outside the scope of the function causes LNK2001. When building a release version of an ATL project, it indicates that the CRT startup code is required. To fix, do one of the following: Remove _ATL_MIN_CRT from the list of preprocessor definitions to allow the CRT startup code to be included. For more information, see General Configuration Settings Property page. If possible, remove the calls to CRT functions that require CRT startup code and use their WIN32 equivalent functions instead. For example, use lstrcmp instead of using strcmp. Known functions that require CRT startup code are some string and floating-point functions.

C + + compilation error 2001 1120

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.