自己聲明一個域名空間 ?在此空間中定義方法,以此防止函數(shù)重名等
#pragma? once
#include "cocos2d.h"
namespace JniFun
{? ? ? ?
? ? ? void ?longinWX(const char* APP_ID,const char* AppSecret);
? ? ? void ?shareImageWX(const char* ImgPath,int nType);
}
然后實(shí)現(xiàn)
#include "JniFun.h"
#include "cocos2d.h"
namespace JniFun
{
? ? ? ? void longinWX(const char* APP_ID,const char* AppSecret)
? ? ? ?{
? ? ? ? }
? ? ? ?void shareImageWX(const char* ImgPath,int nType)
? ? ?{
? ? ?}
}
調(diào)用:
#include "JniFun.h"
JniFun::longinWX("","");
JniFun::shareImageWX("","");