Android program error solution: c ++ _ static error
Recently upgraded to the official version of Cocos2d-x 3.2, iOS program compilation is no problem, the Results Use cocos compile-p android compiler to generate the APK program, the results of the tragedy, the following error occurs.
Android NDK: Invalid APP_STL value: c ++ _ static
Android NDK: Please use one of the following instead: system stlport_static 1_stlport_shared 1_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
Obviously, this error is caused by incorrect STL Library. There are two solutions.
Solution 1: temporary solution
Modify the Application. mk file and replace the first four lines with the following content. Then replace it with OK.
The original content is as follows:
APP_STL: = c ++ _ static
NDK_TOOLCHAIN_VERSION = clang
APP_CPPFLAGS: =-frtti-DCC_ENABLE_CHIPMUNK_INTEGRATION = 1-std = c ++ 11-fsigned-char
APP_LDFLAGS: =-latomic
The content after replacement is as follows:
APP_STL: = gnustl_static
APP_CPPFLAGS: =-frtti-DCOCOS2D_DEBUG = 1-std = c ++ 11-Wno-literal-suffix-fsigned-char
Solution 2:
C ++ _ static is only available in the latest NDK, so you can download the latest NDK.
Too bad !!! Cocos2dx 3.2, Miss cocos2dx3.1.1 ~
Don't understand can add my QQ group: 239982941 (cocos2d-x 3. x Learning Group) Welcome to your arrival Oh, read the blog to some footprints Bai, thank you ~~