HOWTO Cross compiling on Android
What is NDK
NDK (Native Develop Toolkit) is a toolchain from Android official, originally for users who writes native C/C++ code as JNI library. It's not designed for compiling standalone programs (./a.out) and not compatible with automake/cmake etc.
What is Standalone Toolchain
"Standalone" refers to two meanings:
- The program is standalone (has nothing connect to NDK, and don't need helper scripts to run it)
- The toolchain is made for building standalone programs and libs, and which can used by automake etc.
(Optional) Why NDK is hard to use
By default, NDK uses android flavor directory structure when it's finding headers and libs, which is different from GNU flavor, so the compiler cannot find them. For Example: