First of all, you have to have the NDK (Wood has its own search)
/home/xxxx/tools/android-ndk-r12b
Prepare your HelloWorld program source code:
#include <stdio.h>int main (void) { printf ("Hello world!\n " ); return 0 ;}
Compile it:
~/tools/android-ndk-r12b/toolchains/aarch64-linux-android-4.9 / Prebuilt/linux-x86_64/bin/aarch64-linux-android-gcc-o Hello hello.c-pie-fpie-i/home/xxxx/tools/android-ndk-r12b/ Platforms/android-24 /arch-arm64/usr/include-l/home/xxxx/tools/ Android-ndk-r12b/platforms/android-24 /arch-arm64/usr/lib--sysroot=/home/ Xxxx/tools/android-ndk-r12b/platforms/android-24 /arch-arm64/usr/
The no- pie fPIE
compile item will be error-error:only position independent executables (PIE) is supported after the Android L version.
Other parameters are self-understanding, over.
Error resolution Link: http://blog.csdn.net/hxdanya/article/details/39371759
Remark: AHR0CCUZQS8VD3D3LMNUYMXVZ3MUY29TL3POAGQV
Manually invoking the NDK compilation HelloWorld