Cocos2D-X 3.2编译生成Android程序出错的解决措施
发布时间:2021-12-11 12:14:46 所属栏目:教程 来源:互联网
导读:最近升级到Cocos2D-X 3.2正式版,iOS程序编译没任何问题,结果使用cocos compile -p Android编译生成APK程序,结果悲剧了,出现以下错误。 Android NDK: Invalid APP_STL value: c++_static Android NDK: Please use one of the following instead: system st
最近升级到Cocos2D-X 3.2正式版,iOS程序编译没任何问题,结果使用cocos compile -p Android编译生成APK程序,结果悲剧了,出现以下错误。 Android NDK: Invalid APP_STL value: c++_static Android NDK: Please use one of the following instead: system stlport_static stlport_static_hard stlport_shared stlport_shared_hard gnustl_static gnustl_shared gabi++_static gabi++_shared libc++_static libc++_shared none make: Entering directory `/game/physics_engine/proj.android' /sdk/ndk/android-ndk-r9c/build/core/add-application.mk:274: *** Android NDK: Aborting . Stop. make: Leaving directory `/game/physics_engine/proj.android' Error running command, return code: 2 很显然,这个错误是使用了不正确的STL Library,解决方案有如下两个。 方案1:临时方案 修改Application.mk文件,将原来的前4行替换为如下的内容。然后替换就ok了 原来的内容如下: APP_STL := c++_static NDK_TOOLCHAIN_VERSION=clang APP_CPPFLAGS := -frtti -DCC_ENABLE_CHIPMUNK_INTEGRATION=1 -std=c++11 -fsigned-char APP_LDFLAGS := -latomic 替换后的内容如下: APP_STL := gnustl_static APP_CPPFLAGS := -frtti -DCOCOS2D_DEBUG=1 -std=c++11 -Wno-literal-suffix -fsigned-char 方案2: 由于c++_static只有在最新的NDK中才可使用,所以下载最新的NDK就可以了 ![]() (编辑:PHP编程网 - 黄冈站长网) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |