学习cocos2d-x javascript, 遇到绑定的问题, 在google了好多天, 发现教程比较少, 但遇到的麻烦比较多
- test中的std::string会报错, 请含有std::string的函数都删除, 编译就通过了
- test中的c++类如果要include “cocos2d.h”, 该怎么实现呢?
- tojs中需要配置哪些东西才能正确地运行? 我运行到的地方如下, 错误指向ndk中, 便不知道该做些什么了?
我困惑了很久, 企盼高手指教
ritoutoutekiMacBook-Pro:~ lidongdong$ cd /Users/lidongdong/Dev/Android/Tools/cocos2d-2.1beta3-x-2.1.1/tools/tojs
ritoutoutekiMacBook-Pro:tojs lidongdong$ ./genbindings.sh
Paths
NDK_ROOT: /Users/lidongdong/Dev/Android/Tools/android-ndk-r8
CLANG_ROOT: /Users/lidongdong/bin/clang+llvm-3.1
PYTHON_BIN: /opt/local/bin/python2.7
COCOS2DX_ROOT: /Users/lidongdong/Dev/Android/Tools/cocos2d-2.1beta3-x-2.1.1
CXX_GENERATOR_ROOT: /Users/lidongdong/Dev/Android/Tools/cocos2d-2.1beta3-x-2.1.1/tools/cxx-generator
TO_JS_ROOT: /Users/lidongdong/Dev/Android/Tools/cocos2d-2.1beta3-x-2.1.1/tools/tojs
generating userconf.ini…
androidndkdir=/Users/lidongdong/Dev/Android/Tools/android-ndk-r8
clangllvmdir=/Users/lidongdong/bin/clang+llvm-3.1
cocosdir=/Users/lidongdong/Dev/Android/Tools/cocos2d-2.1beta3-x-2.1.1
cxxgeneratordir=/Users/lidongdong/Dev/Android/Tools/cocos2d-2.1beta3-x-2.1.1/tools/cxx-generator
Generating bindings for cocos2dx…
- LD_LIBRARY_PATH=/Users/lidongdong/bin/clang+llvm-3.1/lib
- /opt/local/bin/python2.7 /Users/lidongdong/Dev/Android/Tools/cocos2d-2.1beta3-x-2.1.1/tools/cxx-generator/generator.py /Users/lidongdong/Dev/Android/Tools/cocos2d-2.1beta3-x-2.1.1/tools/tojs/cocos2dx.ini -s cocos2d-x -o /Users/lidongdong/Dev/Android/Tools/cocos2d-2.1beta3-x-2.1.1/tools/tojs/javascript
Using userconfig
(‘androidndkdir’, ‘/Users/lidongdong/Dev/Android/Tools/android-ndk-r8’), (‘clangllvmdir’, ‘/Users/lidongdong/bin/clang+llvm-3.1’), (‘cocosdir’, ‘/Users/lidongdong/Dev/Android/Tools/cocos2d-2.1beta3-x-2.1.1’), (‘cxxgeneratordir’, ‘/Users/lidongdong/Dev/Android/Tools/cocos2d-2.1beta3-x-2.1.1/tools/cxx-generator’)]
… Generating bindings for target spidermonkey
… … Processing section cocos2d-x
====
Errors in parsing headers:
- <severity = Fatal,
location = <SourceLocation file ‘/Users/lidongdong/Dev/Android/Tools/android-ndk-r8/platforms/android-14/arch-arm/usr/include/android/log.h’, line 70, column 10>,
details = “‘stdarg.h’ file not found”>
====
*** Found errors - can not continue