您的位置:首页 > 移动开发 > Cocos引擎

cocos2dx飞机大战开发记录(3)

2015-07-30 16:44 375 查看
1.中文乱码解决办法

在使用中文字符串时先转换为utf-8码

添加以下文件

#include "cocos2d.h"
#include"convert.h"
char* CN(const char* gb2312){
int len = MultiByteToWideChar(CP_ACP, 0, gb2312, -1, NULL, 0);
wchar_t* wstr = new wchar_t[len + 1];
memset(wstr, 0, len + 1);
MultiByteToWideChar(CP_ACP, 0, gb2312, -1, wstr, len);
len = WideCharToMultiByte(CP_UTF8, 0, wstr, -1, NULL, 0, NULL, NULL);
char* str = new char[len + 1];
memset(str, 0, len + 1);
WideCharToMultiByte(CP_UTF8, 0, wstr, -1, str, len, NULL, NULL);
if (wstr) delete[] wstr;
return str;
}

2.错误 3 error LNK1169: 找到一个或多个多重定义的符号

头文件中不能有函数/变量定义
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: