External link error when creating a Singleton Pattern with cocos2d-x

I’ve created a singleton pattern but I get an external link error. I’ve searched everywhere on the net but no fix seems to work.

Error 1 error LNK2001: unresolved external symbol "private: static class MySingleton * MySingleton::m_mySingleton" (?m_mySingleton@MySingleton@@0PAV1@A) C:\Users\User\Desktop\cocos2d\MyProgram\MySingleton.obj
Error 2 error LNK1120: 1 unresolved externals C:\Users\User\Desktop\cocos2d\Debug.win32\MyProgram.win32.exe 1

This is how I implemented it:

//MySingleton.h

#ifndef _MYSINGLETON_H_
#define _MYSINGLETON_H_

#include "cocos2d.h"

class MySingleton
{
private:
    //Constructor
    MySingleton();

    //Instance of the singleton
    static MySingleton* m_mySingleton;

public: 
    //Get instance of singleton
    static MySingleton* mySingleton();  

    //A function that returns zero "0"
    int ReturnZero(){return 0;}

};


#endif //_MYSINGLETON_H_

//MySingleton.cpp
#include "MySingleton.h"

MySingleton::MySingleton()
{   
}

MySingleton* MySingleton::mySingleton(void)
{
    //If the singleton has no instance yet, create one
    if(NULL == m_mySingleton)
    {
        //Create an instance to the singleton
        m_mySingleton = new MySingleton();
    }

    //Return the singleton object
    return m_mySingleton;
}

Then I call the simple methode in the singleton like this:

//in HelloWorldScene.cpp
int zero = MySingleton::mySingleton()->ReturnZero();

Oops, nevermind, figured it out.
All static members in the singleton need to be defined in the .cpp file.

My new fixed .cpp File:

//MySingleton.cpp
#include "MySingleton.h"

//All static variables need to be defined in the .cpp file
//I've added this following line to fix the problem
MySingleton* MySingleton::m_mySingleton = NULL;

MySingleton::MySingleton()
{   
}

MySingleton* MySingleton::mySingleton(void)
{
    //If the singleton has no instance yet, create one
    if(NULL == m_mySingleton)
    {
        //Create an instance to the singleton
        m_mySingleton = new MySingleton();
    }

    //Return the singleton object
    return m_mySingleton;
}

Can someone still tell me if this singleton is ok to use with cocos2d-x?
Or do I need to add anything else?
Where should I delete the instance of this singleton?

How about deleting it in the:

AppDelegate::~AppDelegate()

Is that appropriate?

You should determine the lifetime of the instance of a singleton.
You can delete it at anywhere.