Non puoi selezionare più di 25 argomenti Gli argomenti devono iniziare con una lettera o un numero, possono includere trattini ('-') e possono essere lunghi fino a 35 caratteri.
 
 
 
 
 
Henry Case bcd12b6b42 Merges multiple repositories into one 5 anni fa
..
hello_world Merges multiple repositories into one 5 anni fa
README.md Merges multiple repositories into one 5 anni fa

README.md

How to compile C++ hello world with Android NDK

  1. Create following directory structure:

    hello_world/
      jni/
      libs/
    
  2. In the jni directory create two files

    1. Android.mk:

      LOCAL_PATH := $(call my-dir)
      include $(CLEAR_VARS) 
             
      # give module name
      LOCAL_MODULE    := hello_world  
             
      # list your C files to compile
      LOCAL_SRC_FILES := test.c
      
      

    This seems to be needed for Android M on ARMv8

    LOCAL_CFLAGS = -fPIE LOCAL_LDFLAGS = -fPIE -pie

     include $(BUILD_EXECUTABLE)
     ```
    
    1. test.c

      #include <stdio.h>
      #include <stdlib.h>
      int main()
      {
           printf("Hello World\n");
           return 0;
      }
      
  3. Export PATH to NDK

    export PATH=/usr/local/softs/android-ndk-r10e:$PATH
    
  4. Go to jni directory

  5. Call ndk-build

  6. Result should be in hello_world/libs/armeabi/hello_world