cocos2d-x3.2 lua绑定出现了下面的问题

generating userconf.ini...

Generating bindings for cocos2dx...

Using userconfig

]

.... Generating bindings for target lua

.... .... Processing section cocos2d-x

Traceback (most recent call last):

File "/Users/mac/Downloads/cocos2d-x-3.2/tools/bindings-generator/generator.py", line 1343, in

main()

File "/Users/mac/Downloads/cocos2d-x-3.2/tools/bindings-generator/generator.py", line 1318, in main

'headers': (config.get(s, 'headers' , 0, dict(userconfig.items('DEFAULT')))),

File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ConfigParser.py", line 623, in get

return self._interpolate(section, option, value, d)

File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ConfigParser.py", line 691, in _interpolate

self._interpolate_some(option, L, rawval, section, vars, 1)

File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ConfigParser.py", line 723, in _interpolate_some

option, section, rest, var)

InterpolationMissingOptionError: Bad value substitution:

section:

option : headers

key : cocosdir

rawval : /cocos/cocos2d.h %(cocosdir)s/cocos/audio/include/SimpleAudioEngine.h %(cocosdir)s/cocos/ui/rotectedNode.h %(cocosdir)s/cocos/3d/CCAnimation3D.h %(cocosdir)s/cocos/3d/CCAnimate3D.h

---------------------------------

Generating lua bindings fails.


userconf.ini文件是自动生成的

androidndkdir = /Users/mac/Downloads/android-ndk-r10

clangllvmdir = /Users/mac/Downloads/android-ndk-r10/toolchains/llvm-3.4/prebuilt/darwin-x86_64

cocosdir = /Users/mac/Downloads/cocos2d-x-3.2

cxxgeneratordir = /Users/mac/Downloads/cocos2d-x-3.2/tools/bindings-generator

extra_flags =


大哥,我也遇到了这个问题,我把当前目录改变为tolua的目录就好了.

cd ools olua

求解决问题~~~~~~~~~~~~~~~~~~~~

不行,我就是在tools\tolua下运行的,报的错是

X:\CocosLuaPrjs\LuaTest02\frameworks\cocos2d-x\tools\tolua>python genbindings.py

PYTHON_BIN not defined, use current python.

generating userconf.ini...

Generating bindings for custom_api...

D:\Python27\python.exe: can't open file 'X:\CocosLuaPrjs\LuaTest02\frameworks\co

cos2d-x\tools\bindings-generator//generator.py': No such file or direct

ory

---------------------------------

Generating lua bindings fails.

---------------------------------

X:\CocosLuaPrjs\LuaTest02\frameworks\cocos2d-x\tools\tolua>

继续尝试,发现frameworkscocos2d-x oolsindings-generator目录下只有目录,没有内容,于是把D:\cocos2d-x-3.2\tools\bindings-generator所有内容拷贝到X:\CocosLuaPrjs\LuaTest02\frameworks\cocos2d-x\tools\bindings-generator

得到如下结果

X:\CocosLuaPrjs\LuaTest03\frameworks\cocos2d-x\tools\tolua>python genbindings.py

PYTHON_BIN not defined, use current python.

generating userconf.ini...

Generating bindings for custom_api...

Using userconfig

('androidndkdir', 'D:\android_dev\android-ndk-r9d'), ('clangllvmdir', 'D:\

android_dev\android-ndk-r9d\toolchains\llvm-3.3\prebuilt\windows-x86_64'),

('cocosdir', 'X:\CocosLuaPrjs\LuaTest03\frameworks\cocos2d-x'), ('cxxgenerat

ordir', 'X:\CocosLuaPrjs\LuaTest03\frameworks\cocos2d-x\tools\bindings-gen

erator'), ('extra_flags', '-D__WCHAR_MAX__=0x7fffffff -U__MINGW32__')]

.... Generating bindings for target lua

.... .... Processing section custom_api

Traceback (most recent call last):

File "X:\CocosLuaPrjs\LuaTest03\frameworks\cocos2d-x\tools\bindings-generator/

generator.py", line 1342, in

main()

File "X:\CocosLuaPrjs\LuaTest03\frameworks\cocos2d-x\tools\bindings-generator/

generator.py", line 1320, in main

'clang_args': (config.get(s, 'extra_arguments', 0, dict(userconfig.items('DE

FAULT'))) or "").split(" "),

File "D:\Python27\lib\ConfigParser.py", line 618, in get

raise NoOptionError(option, section)

NoOptionError: No option 'extra_arguments' in section: 'custom_api'

---------------------------------

Generating lua bindings fails.

---------------------------------

请问你用的是哪个版本, 成功绑定了

我的问题解决了,就是路径问题,你得进入tulua的文件夹下跑python genbindings.py命令,直接在外面打一长串路径是不行的~

:14::14::14::14::14::14::14: