i8d0g
V2EX  ›  问与答

想问个 cocos2d 的 js binding 的问题

  •  
  •   i8d0g · Sep 13, 2014 · 4882 views
    This topic created in 4296 days ago, the information mentioned may be changed or developed.
    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++知识再一次挫败了我...
    Supplement 1  ·  Sep 13, 2014
    我好像突然觉悟了 我去装个MinGW
    4 replies    2014-09-13 13:22:28 +08:00
    Mutoo
        1
    Mutoo  
       Sep 13, 2014
    cocos2d-js 3.0 final release 昨天发布了。另外对 ndk 的最低版本要求是:
    NDK version must be r9d
    i8d0g
        2
    i8d0g  
    OP
       Sep 13, 2014
    @Mutoo
    但是这个binding-generator里注释 ndk必须是r9b
    Mutoo
        3
    Mutoo  
       Sep 13, 2014   ❤️ 1
    @i8d0g rc版坑蛮多的,建议直接上 final

    r9d是官方的发布布上写的
    http://cocos2d-x.org/news/341
    i8d0g
        4
    i8d0g  
    OP
       Sep 13, 2014
    @Mutoo
    不知道final发布了
    刚下载了3.0 final之后尝试下了, 一次过了...
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2306 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 31ms · UTC 00:45 · PVG 08:45 · LAX 17:45 · JFK 20:45
    ♥ Do have faith in what you're doing.