如题所述, git clone cocos2dx-lite之后, npm install, init submodule, download-dependencies, generate-binding结果如下.
不但有变化, 而且编译会出错, 原因在下图的红框中.
请鉴定一下问题.
如题所述, git clone cocos2dx-lite之后, npm install, init submodule, download-dependencies, generate-binding结果如下.
你的电脑是windows还是mac?
能具体说下你是如何生成绑定的么?
正确的姿势应该是:
git clone https://github.com/cocos-creator/cocos2d-x-lite.git -o upstream
cd cocos2d-x-lite
git submodule update --init
python download-deps.py
cd tools/tojs
python genbindings.py
windows
我就是这么做的.
下面是一些环境信息:
![]()
![]()
![]()
![]()
生成之后就发现有js,hpp和cpp的变化.
其他文件的差异呢?
把差异的文件都提交一下。我明天用windows电脑生成一下看看。
如果只是顺序问题,那没啥关系。可能不同系统生成的绑定函数的顺序有一点不一样,只要逻辑是相同的那就没问题。
正在试,之前没有配置windows的bindings-generator的环境,现在正在配置。
const char* to char* 的问题,我这重现了,我先看看。
嗯, 我目前先手动改的文件解决的这个问题…
Pull Request:
https://github.com/cocos-creator/cocos2d-x-lite/pull/908
具体的修改在:
https://github.com/cocos-creator/bindings-generator/pull/20
你可以只改:
+ if nt.name == 'va_list':
+ ret.not_supported = True
修复这个问题。
int和long那个是因为std::size_t在windows上和mac上定义不一样导致的,这个暂时不影响编译与结果。先不处理。其他差异基本上就是顺序问题,还有文件行结束符不一样。
收到, 辛苦了, 谢谢.