V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX 提问指南
i8d0g
V2EX  ›  问与答

想问个 cocos2d 的 js binding 的问题

  •  
  •   i8d0g · 2014-09-13 11:15:22 +08:00 · 4338 次点击
    这是一个创建于 3520 天前的主题,其中的信息可能已经有所发展或是发生改变。
    cocos2d-js 3.0rc版, python 2.7.8, android-ndk-r9b

    用bindings-generator去生成的时候总会报错
    ====
    Errors in parsing headers:
    1. <severity = Warning,
    location = <SourceLocation file None, line 168, column 9>,
    details = "'__WCHAR_MAX__' macro redefined">
    2. <severity = Fatal,
    location = <SourceLocation file 'd:/hello/tools/bindings-generator/test/../test/simple_test/simple_class.h', line 4, column 10>,
    details = "'string' file not found">
    ====
    看这个用来生成批处理程序里是引用的ndk里带的llvm,而

    if "%TEMP%"=="" set TEMP=windows
    set NDK_LLVM_ROOT=%NDK_ROOT%/toolchains/llvm-3.3/prebuilt/%TEMP%

    以我非常有限的c/c++知识,我去找个prebuilt路径下的include目录找了下,确实没有看到string.h这么个文件..

    如果有人能告诉我漏掉了什么 赶紧不尽....



    另外,我尝试下载其他人生成好的js binding的代码添加到我的工程里,按帮助注册到AppDelegate.cpp里
    然后再添加到android的jni工程里的Android.mk的LOCAL_SRC_FILES,在但是在生成的时候报错

    ./obj/local/armeabi/objs/cocos2djs_shared/__/__/Classes/JSB_AUTO.o:jni/../../Classes/JSB_AUTO.cpp:function _MergedGlobals: error: undefined reference to 'js_functionTest(JSContext*, unsigned int, JS::Value*)'
    clang++.exe: error: linker command failed with exit code 1 (use -v to see invocation)

    我想应该又是我在哪里出错了 但是我非常有限的c/c++知识再一次挫败了我...
    第 1 条附言  ·  2014-09-13 11:58:23 +08:00
    我好像突然觉悟了 我去装个MinGW
    4 条回复    2014-09-13 13:22:28 +08:00
    Mutoo
        1
    Mutoo  
       2014-09-13 12:02:57 +08:00
    cocos2d-js 3.0 final release 昨天发布了。另外对 ndk 的最低版本要求是:
    NDK version must be r9d
    i8d0g
        2
    i8d0g  
    OP
       2014-09-13 12:51:03 +08:00
    @Mutoo
    但是这个binding-generator里注释 ndk必须是r9b
    Mutoo
        3
    Mutoo  
       2014-09-13 13:15:20 +08:00   ❤️ 1
    @i8d0g rc版坑蛮多的,建议直接上 final

    r9d是官方的发布布上写的
    http://cocos2d-x.org/news/341
    i8d0g
        4
    i8d0g  
    OP
       2014-09-13 13:22:28 +08:00
    @Mutoo
    不知道final发布了
    刚下载了3.0 final之后尝试下了, 一次过了...
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   1728 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 27ms · UTC 00:22 · PVG 08:22 · LAX 17:22 · JFK 20:22
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.