(已解决)cocos2dx 3.2 导出自定义类到lua失败

WIN7下按照官方说明:

On Windows:

运行py脚本报错如下:

File “E:\projectSpace\cocos2d-x-3.2\tools\bindings-generator\clang\cindex.py”, line 3286, in regis
ter_function
raise LibclangError(msg)
LibclangError: function ‘clang_annotateTokens’ not found. Please ensure that your python bindings ar
e compatible with your libclang.so version.

:12:

自己解决了,应该是clang.dll的问题,把cindex.py中的get_cindex_library函数修改如下:

def get_cindex_library(self):
    try:
 

        dllPath='E:/projectSpace/cocos2d-x-3.2/GenerateLua/bindings-generator/libclang/libclang.dll';
        library = cdll.LoadLibrary(dllPath)

    except OSError as e:
        msg = str(e) + ". To provide a path to libclang use " \
                       "Config.set_library_path() or " \
                       "Config.set_library_file()."
        raise LibclangError(msg)

    return library

dllPath改成你自己的路径

有效,多谢分享

mac os 更新系统之后也会出错
参考你的修改只有一点不一样
dllPath=‘E:/projectSpace/cocos2d-x-3.2/GenerateLua/bindings-generator/libclang/libclang.dylibl’;

感谢提供修改思路。

http://stackoverflow.com/questions/22730935/why-cant-this-python-script-find-the-libclang-dll
我碰到的楼上方法不行 重装32位python就可以了