开始学习cocos2d-x-3.*
凭着对2.*的各个版本的认识和升级的经验,本以为直接用最新的3.2rc0版本练手应该没有问题,结果一上来就是一个大坑。你妹!
Android NDK: Invalid APP_STL value:c++_static
搞了一下午,对比了3.1.1,3.2alpha0,3.2rc0
终于找到了2个解决办法:
1.升级android-ndk-r9b为最新的android-ndk-r9d (下载地址:https://developer.android.com/tools/sdk/ndk/index.html),此乃上上策!
2.修改jni/Application.mk:
把前4行:
[plain] view plaincopy
- APP_STL := c++_static
- NDK_TOOLCHAIN_VERSION=clang
- APP_CPPFLAGS := -frtti -DCC_ENABLE_CHIPMUNK_INTEGRATION=1 -std=c++11 -fsigned-char
- APP_LDFLAGS := -latomic
换成:
[plain] view plaincopy
- APP_STL := gnustl_static
- # add -Wno-literal-suffix to avoid warning: warning: invalid suffix on literal; C++11 requires a space between literal and identifier [-Wliteral-suffix]
- # in NDK_ROOT/arch-arm/usr/include/sys/cdefs_elf.h:35:28: when using ndk-r9
- APP_CPPFLAGS := -frtti -DCOCOS2D_DEBUG=1 -std=c++11 -Wno-literal-suffix -fsigned-char
即可!
时间: 2024-10-10 13:13:56