Manually invoking the NDK compilation HelloWorld

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.