C + + program link failed, unresolved external command, unresolved external symbol "Private:static class * object::current"

Source: Internet
Author: User

After the C + + program compiles, a link failure prompt appears:

Severity Code description project file row category suppress display status
Error LNK2001 unresolved external symbol "Private:static class object* Object::current" ([email protected]@@[email protected]) objec T F:\c++\object.obj 1
Severity Code description project file row category suppress display status
Error LNK1120 1 unresolved external commands Object F:\c++\object.exe 1 fatal

One

If you write a class that uses static methods, static variables , check whether static variables are initialized before the object is instantiated;

such as: Defined in class object

Private :       Static Object *current;

Check if you have implemented outside of the class

Object * Object:: current = NULL;

Second,

Check the header file, the method of class declaration, whether in the source file is implemented ;

A method that does not implement the body of a function in VS2015 will prompt

The complete approach:

C + + program link failed, unresolved external command, unresolved external symbol "Private:static class * object::current"

Related Article

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.