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"