jsb cocos2dx 绑定过程中遇到的问题
注意: python一定要安装32位的下面是cocos官方的描述
On Windows:
------------
* Make sure that you have installed `android-ndk-r10c` or later.
* 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.11.win32-py2.7.exe and install it.
* Download pyCheetah from https://raw.github.com/dumganhar/cocos2d-x/download/downloads/Cheetah.zip,unzip it to "C:\Python27\Lib\site-packages"
* Set environment variables (`NDK_ROOT`) and `PYTHON_BIN`
* Go to "cocos2d-x/tools/tojs" folder,and run "genbindings.py". The generated codes will be under "cocos\scripting\auto-generated\js-bindings".
1、在安装 python插件cheetah的时候遇到的问题
in query_vcvarsall raise ValueError(str(list(result.keys()))) ValueError: [u'path'] 解决
2、安装pythonn插件的时候
no module named setuptool
单独下载setuptool模块参见文章
http://blog.csdn.net/u010693827/article/details/78333740
注:当时我按照上述方法安装还是不行,提示同样的错误,我重新安装了python。并且在重新安装的时候把所有的选项都勾选了,之后就可以了
3、在工程目录下frameworks\cocos2d-x\tools缺少文件夹bindings-generator
从相应的cocos框架下copy一份过来就可以了
4、自动绑定已经成功,但在js层面调用类的时候显示无构造函数
在写需要绑定的c++类的时候一定要显示写出构造函数,不能用默认构造函数,否则在自动绑定生成类的时候不会生成构造函数,就会报上述错误了
原文链接:https://www.f2er.com/cocos2dx/338325.html