cocos2d-x bindings-generator安装过程备忘录

记录一下安装过程。面得以后忘记了 

 

--------------------------------------------------------------------------
-- Desc: cocos2d-x 3.10 bindings-generator 安装过程
--------------------------------------------------------------------------
-- 官方地址(https://github.com/cocos2d/bindings-generator)
-- 参考说明(..\cocos2d-x\tools\bindings-generator\README.md)

### Windows 7 64bit
* Download python2.7.3 (`32bit`) from (http://www.python.org/ftp/python/2.7.3/python-2.7.3.msi).
* Add the installed path of python (e.g. C:\Python27) to windows environment variable named 'PATH'.
* Download pyyaml from http://pyyaml.org/download/pyyaml/PyYAML-3.10.win32-py2.7.exe and install it.
* Download pyCheetah from https://raw.github.com/dumganhar/my_old_cocos2d-x_backup/download/downloads/Cheetah.zip, unzip it to "C:\Python27\Lib\site-packages"
* Download [64bit NDK-r9b](http://dl.google.com/android/ndk/android-ndk-r9b-windows-x86_64.zip) from [google](http://developer.android.com/tools/sdk/ndk/index.html)
* Set the environment variables (`PYTHON_ROOT` and `NDK_ROOT`) or just them in `test.bat`.
* Run "test.bat". The generated codes will be under "simple_test_bindings".


### Windows 7 64bit 
1.下载python python2.7.3 (32bit) (http://www.python.org/ftp/python/2.7.3/python-2.7.3.msi)
    添加python目录到系统环境path (C:\Python27;)
2.下载PyYAML(32bit)安装  (http://pyyaml.org/download/pyyaml/PyYAML-3.10.win32-py2.7.exe)
    安装报错找不到python:
        添加注册表 [HKEY_LOCAL_MACHINE\SOFTWARE\Python\PythonCore\2.5\InstallPath] 键值[REG_SZ]:[C:\Python27\]
3.下载Cheetah模版 (https://raw.github.com/dumganhar/my_old_cocos2d-x_backup/download/downloads/Cheetah.zip)
    解压直接拷贝到(C:\Python27\Lib\site-packages)
4.下载NDK-r9b (http://dl.google.com/android/ndk/android-ndk-r9b-windows-x86_64.zip)
    注意版本别搞错了
5.填写环境变量NDK_ROOT PYTHON_ROOT ANDROID_NDK_HOME ANDROID_NDK_ROOT
    可以直接用写的批处理ChangeNDK_me.bat
6.重启电脑生效环境变量
7.全程虽然机器是x64... 但是所有工具都特么的32bit....


--- 安装完毕,使用
1.CD到目录 ..\mobile2\frameworks\runtime-src\Classes\tolua\
2.运行python genbindings.py
3.可以奔放了...

 

 

下面是: ChangeNDK_me.bat

@echo off
echo ---------------------------------------------------
echo input you selected
echo 1:NDK-r10e(cocosstudio)
echo 2:NDK-r16(Lua-binding_r16)
echo 3:NDK-r9b(Lua-binding_r9b)
echo ---------------------------------------------------
set /p option=

setx PYTHON_ROOT C:\Python27
if %option% EQU 1 goto switchToR10e
if %option% EQU 2 goto switchToR16
if %option% EQU 3 goto switchToR9b

echo input error. auto close.
goto finish

:switchToR10e
setx ANDROID_NDK_HOME D:\Cocos\tools\android-ndk-r10e
setx ANDROID_NDK_ROOT D:\Cocos\tools\android-ndk-r10e
setx NDK_ROOT D:\Cocos\tools\android-ndk-r10e
echo ok.. now:r10e
goto finish

:switchToR16:
setx ANDROID_NDK_HOME F:\cocos_tool_ins\android-ndk-r16
setx ANDROID_NDK_ROOT F:\cocos_tool_ins\android-ndk-r16
setx NDK_ROOT F:\cocos_tool_ins\android-ndk-r16
echo ok.. now:r16
goto finish

:switchToR9b:
setx ANDROID_NDK_HOME F:\cocos_tool_ins\android-ndk-r9b
setx ANDROID_NDK_ROOT F:\cocos_tool_ins\android-ndk-r9b
setx NDK_ROOT F:\cocos_tool_ins\android-ndk-r9b
echo ok.. now:r9b
goto finish

:finish:
pause

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值