操作环境
操作系统:Windows7
VS版本:2013
Cocos2d-x版本:3.0
工程路径:E:\cocos2d-prj\
1.从github下载libpomelo代码
E:\cocos2d-prj> git clone https://github.com/NetEase/libpomelo.git
2.创建libpomelo的VS工程
E:\cocos2d-prj>cd libpomelo E:\cocos2d-prj\libpomelo>mkdir build E:\cocos2d-prj\libpomelo>git clone https://github.com/martine/gyp.git build/gyp E:\cocos2d-prj\libpomelo>build\gyp\gyp.bat --depth=. pomelo.gyp -Dlibrary=static_library -DTO=pc
如果遇到报错(一个VS版本问题)
修改E:\snake\code\client\libpomelo\build\gyp\pylib\gyp\MSVSVersion.py文件第188行
return versions[str(name)]
改为
return versions[“2010”]
修改后继续执行脚本
E:\cocos2d-prj\libpomelo>build\gyp\gyp.bat --depth=. pomelo.gyp -Dlibrary=static_library -DTO=pc
3.创建libuv的VS工程(执行E:\cocos2d-prj\libpomelo\deps\uv\vcbuild.bat脚本即可)
E:\cocos2d-prj>cd libpomelo\deps\uv E:\cocos2d-prj\libpomelo\deps\uv>vcbuild.bat
4.打开cocos2d工程,将下列vs项目加入工程(add existing project)
E:\cocos2d-prj\libpomelo\libpomelo.vcxproj E:\snake\code\client\libpomelo\deps\jansson\jansson.vcxproj E:\snake\code\client\libpomelo\deps\uv\libuv.vcxproj
5.修改工程版本
vs中右键上述工程,选择菜单 Upgrade VC++ Compiler and Libraries
Android和IOS平台待续....
时间: 2024-11-07 05:49:48