Home > other >  Establish a static variable in a cocos2dx
Establish a static variable in a cocos2dx

Time:09-24

Have a ODSocket class in my project, and then I in other class defines a static ODSocket socket;

Why not? Compile time error

LNK2001 unresolved external symbols

CodePudding user response:

Although I don't know, try to create a pointer class object

CodePudding user response:

This is an external symbol cannot identify problems, is the definition of couldn't find you,
General compiler encountered such a situation, there are two possible one is you refer to the third-party libraries, call them, but you can't link in the library;
The second is the way of your own statement does not define it, and then the call when it comes to such a mistake,
See if your class object socket in the outside is not defined? Or do you have defined class?
  • Related