Posts

Android Native C++ Compilation

# Set Toolchain Table 1. APP_ABI Settings for Different Command Sets | Architecture | Toolchain Name | | ---------- | ------------------------------------ | | ARM | arm-linux-androideabi-**{gcc-version}** | | x86 | x86-**{gcc-version}** | | MIPS | mipsel-linux-android-**{gcc-version}** | | ARM64 | aarch64-linux-android-**{gcc-version}** | | X86-64 | x86\_64-**{gcc-version}** | | MIPS64 | mips64el-linux-android-**{gcc-version}** | # Set Sysroot ``` SYSROOT=$NDK/platforms/android-21/arch-arm ``` # Call Compiler ## Simple call The following is a build method using the `arm-linux-androideabi-4.8` toolchain, which is pre-built within NDK. ``` export CC="$NDK/toolchains/arm-linux-androideabi-4.8/prebuilt/ \ linux-x86/bin/arm-linux-androideabi-gcc-4.8 --sysroot=$SYSROOT" $CC -o foo.o -c foo.c ``` C++ STL (STLport, libc++, or GNU libstdc++) is not available in this method. No exceptions or RTTI are supported. ## Advanced call NDK provides a 'make-standalo...
Recent posts