美文网首页
cocos2d-x 遇到的问题

cocos2d-x 遇到的问题

作者: 你在心上_b28f | 来源:发表于2020-04-01 14:40 被阅读0次

    1.xcode运行helloworld工程:Argument value 10880 is outside the valid range [0, 255]

    需要把
    #define BT_SHUFFLE(x,y,z,w) ((w)<<6 | (z)<<4 | (y)<<2 | (x))
    改为
    #define BT_SHUFFLE(x, y, z, w) (((w) << 6 | (z) << 4 | (y) << 2 | (x)) & 0xff)

    2 'system' is unavailable: not available on iOS

    解决办法:https://github.com/cocos2d/cocos2d-x/pull/17921/files

    3.Reference to 'Terrain' is ambiguous
    存在相同的头文件和cpp文件。比如库里面有一个,项目有一个是同一个文件名,解决办法,修改文件名

    4.# [Xcode 10 Error: Multiple commands produce]
    解决方法:选择Build System为Legacy Build system

    5.打开共享盘 在文件夹 common +k,打开指定目录 open. 目录

    6.ndk 打包so遇到的问题:the vtable symbol may be undefined because the class is missing its key func

    解决方法:LOCAL_ALLOW_UNDEFINED_SYMBOLS := true

    7:运行打包后的apk报错:dlopen failed: cannot locate symbol "_ZTV14BeginAnimation" referenced by "/data/app/com.kankan.king-1/lib/arm/libcocos2dcpp.so"...

    解决方法 LOCAL_LDFLAGS += -fuse-ld=bfd

    8:打包找不到cpp源文件,和点.h文件

    LOCAL_SRC_FILES:
    MY_CPP_LIST := (wildcard(LOCAL_PATH)/../../../Classes/Scene/.cpp)
    MY_CPP_LIST += (wildcard(LOCAL_PATH)/../../../Classes/Bullet/
    .cpp)
    MY_CPP_LIST += (wildcard(LOCAL_PATH)/../../../Classes/Data/.cpp)
    MY_CPP_LIST += (wildcard(LOCAL_PATH)/../../../Classes/Layer/
    .cpp)
    MY_CPP_LIST += (wildcard(LOCAL_PATH)/../../../Classes/Layer/Menu/.cpp)
    MY_CPP_LIST += (wildcard(LOCAL_PATH)/../../../Classes/Map/
    .cpp)
    MY_CPP_LIST += (wildcard(LOCAL_PATH)/../../../Classes/Monster/.cpp)
    MY_CPP_LIST += (wildcard(LOCAL_PATH)/../../../Classes/Monster/Boss/
    .cpp)
    MY_CPP_LIST += (wildcard(LOCAL_PATH)/../../../Classes/Monster/Undergroud/.cpp)
    MY_CPP_LIST += (wildcard(LOCAL_PATH)/../../../Classes/Monster/Jungle/
    .cpp)
    MY_CPP_LIST += (wildcard(LOCAL_PATH)/../../../Classes/Monster/Desert/.cpp)
    MY_CPP_LIST += (wildcard(LOCAL_PATH)/../../../Classes/Road/
    .cpp)
    MY_CPP_LIST += (wildcard(LOCAL_PATH)/../../../Classes/Scene/Introduction/.cpp)
    MY_CPP_LIST += (wildcard(LOCAL_PATH)/../../../Classes/Scene/UpdateTowerScene/
    .cpp)
    MY_CPP_LIST += (wildcard(LOCAL_PATH)/../../../Classes/Scene/Story.cpp)
    MY_CPP_LIST += (wildcard(LOCAL_PATH)/../../../Classes/Soldier/
    .cpp)
    MY_CPP_LIST += (wildcard(LOCAL_PATH)/../../../Classes/Sprite/.cpp)
    MY_CPP_LIST += (wildcard(LOCAL_PATH)/../../../Classes/Sprite/TowerIcon/
    .cpp)
    MY_CPP_LIST += (wildcard(LOCAL_PATH)/../../../Classes/Sprite/Circle/.cpp)
    MY_CPP_LIST += (wildcard(LOCAL_PATH)/../../../Classes/Tower/
    .cpp)

    LOCAL_SRC_FILES := hellocpp/main.cpp
    ../../../Classes/AppDelegate.cpp
    ../../../Classes/HelloWorldScene.cpp

    LOCAL_SRC_FILES += (MY_CPP_LIST:(LOCAL_PATH)/%=%)

    LOCAL_C_INCLUDES := $(LOCAL_PATH)/../../../Classes

    LOCAL_C_INCLUDES += (LOCAL_PATH)/../../../Classes/Bullet LOCAL_C_INCLUDES +=(LOCAL_PATH)/../../../Classes/Scene
    LOCAL_C_INCLUDES += (LOCAL_PATH)/../../../Classes/Data LOCAL_C_INCLUDES +=(LOCAL_PATH)/../../../Classes/Layer
    LOCAL_C_INCLUDES += (LOCAL_PATH)/../../../Classes/Layer/Menu LOCAL_C_INCLUDES +=(LOCAL_PATH)/../../../Classes/Map
    LOCAL_C_INCLUDES += (LOCAL_PATH)/../../../Classes/Monster LOCAL_C_INCLUDES +=(LOCAL_PATH)/../../../Classes/Monster/Boss
    LOCAL_C_INCLUDES += (LOCAL_PATH)/../../../Classes/Monster/Underground LOCAL_C_INCLUDES +=(LOCAL_PATH)/../../../Classes/Monster/Jungle
    LOCAL_C_INCLUDES += (LOCAL_PATH)/../../../Classes/Monster/Desert LOCAL_C_INCLUDES +=(LOCAL_PATH)/../../../Classes/Road
    LOCAL_C_INCLUDES += (LOCAL_PATH)/../../../Classes/Scene/Introduction LOCAL_C_INCLUDES +=(LOCAL_PATH)/../../../Classes/Scene/UpdateTowerScene
    LOCAL_C_INCLUDES += (LOCAL_PATH)/../../../Classes/Scene/Story LOCAL_C_INCLUDES +=(LOCAL_PATH)/../../../Classes/Soldier
    LOCAL_C_INCLUDES += (LOCAL_PATH)/../../../Classes/Sprite LOCAL_C_INCLUDES +=(LOCAL_PATH)/../../../Classes/Sprite/TowerIcon
    LOCAL_C_INCLUDES += (LOCAL_PATH)/../../../Classes/Sprite/Circle LOCAL_C_INCLUDES +=(LOCAL_PATH)/../../../Classes/Tower

    9.arm-linux-androideabi-gcc-ar: No such file or directory ndk11 报错

    10.libfreetype.a exists or that its path is correct ndk14,ndk12报错

    1. "child already added. It can't be added again"

    相关文章

      网友评论

          本文标题:cocos2d-x 遇到的问题

          本文链接:https://www.haomeiwen.com/subject/defauhtx.html