eclipse编译cocos2d-x2.2.x移植到Android

访问我的个人博客 秋码个人博客
1、下载NDK
可从官网下载 https://developer.android.google.cn/ndk/downloads/index.html 但官网都是最新的,提供几个版本下载
r12b windows 32位
https://dl.google.com/android/repository/android-ndk-r12b-windows-x86.zip
64位
https://dl.google.com/android/repository/android-ndk-r12b-windows-x86_64.zip
Mac 64位
https://dl.google.com/android/repository/android-ndk-r12b-darwin-x86_64.zip
Linux 64位
https://dl.google.com/android/repository/android-ndk-r12b-linux-x86_64.zip
r11c windows 32位
https://dl.google.com/android/repository/android-ndk-r11c-windows-x86.zip
64位
https://dl.google.com/android/repository/android-ndk-r11c-windows-x86_64.zip
mac 64位
https://dl.google.com/android/repository/android-ndk-r11c-darwin-x86_64.zip
Linuc 64位
https://dl.google.com/android/repository/android-ndk-r11c-linux-x86_64.zip
r10e windows 32位
https://dl.google.com/android/ndk/android-ndk-r10e-windows-x86.exe
64位
https://dl.google.com/android/ndk/android-ndk-r10e-windows-x86_64.exe
mac 64位
https://dl.google.com/android/repository/android-ndk-r10e-darwin-x86_64.zip
Linux 64位
https://dl.google.com/android/repository/android-ndk-r10e-linux-x86_64.zip
r9d windows 32位
http://dl.google.com/android/ndk/android-ndk-r9d-windows-x86.zip
64位
http://dl.google.com/android/ndk/android-ndk-r9d-windows-x86_64.zip
mac64位
https://dl.google.com/android/ndk/android-ndk-r9d-darwin-x86_64.tar.bz2
Linux 64位
https://dl.google.com/android/ndk/android-ndk-r9d-linux-x86_64.tar.bz2
r8e windows 32位
https://dl.google.com/android/ndk/android-ndk-r8e-windows-x86.zip
64位
https://dl.google.com/android/ndk/android-ndk-r8e-windows-x86_64.zip
mac64位
https://dl.google.com/android/ndk/android-ndk-r8e-darwin-x86_64.tar.bz2
Linux 64位
https://dl.google.com/android/ndk/android-ndk-r8e-linux-x86_64.tar.bz2
r7d Windows 32位
https://dl.google.com/android/ndk/android-ndk-r7c-windows.zip
mac 64位
https://dl.google.com/android/ndk/android-ndk-r7c-darwin-x86.tar.bz2
Linux 64位
https://dl.google.com/android/ndk/android-ndk-r7c-linux-x86.tar.bz2
我用的是r9d 64位的
http://dl.google.com/android/ndk/android-ndk-r9d-windows-x86_64.zip
2、下载Android SDK
可从此处下载 http://tools.android-studio.org/index.php/sdk
因为使用eclipse 所以还要配置Android 插件 就是下载 ADT
3、下载ADT
http://tools.android-studio.org/index.php/adt-bundle-plugin
然后在eclipse配置下
这里写图片描述
这里写图片描述
然后在eclipse配置 AndroidSDK 和NDK所在路径
这里写图片描述
这里写图片描述
4、创建cocos2d-x项目
这里写图片描述
eclipse导入proj.android项目
这里写图片描述
然后拷贝 org/cocos2dx/lib到src下
这里写图片描述
右击项目属性
这里写图片描述
这里写图片描述
这里写图片描述
打开Android.mk文件进行 添加

$(call import-add-path,F:/BaiduNetdiskDownload/sanguo2.2.1/cocos2d-x-2.2.1/cocos2d-x-2.2.1)
$(call import-add-path,F:/BaiduNetdiskDownload/sanguo2.2.1/cocos2d-x-2.2.1/cocos2d-x-2.2.1/cocos2dx/platform/third_party/android/prebuilt)

这里写图片描述
因为使用 r9d 使用 在Android.mk 加了

APP_CPPFLAGS += -Wno-error=format-security

这里写图片描述
最后 run as application
这里写图片描述
模拟器启动有点慢 反正是运行成功了
这里写图片描述

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

甄齐才

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值