I compiled simple file main.cpp using android-ndk-r8b:
#include <stdio.h>
#include <stdlib.h>
int main(void) {
puts("!!!Hello World!!!");
return EXIT_SUCCESS;
}
I used command as follow:
…/android-ndk-r8b/ndk-build APP_ABI=x86
from the directory of main.cpp file
My Android.mk file:
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_CFLAGS += -fPIC
LOCAL_MODULE := main
LOCAL_SRC_FILES := main.cpp
include $(BUILD_EXECUTABLE)
Then I tried to open this file on debian x86 and I have this information:
./main: No such file or directory
then I used command:
ld main
and had information:
ld: error in main(.eh_frame); no .eh_frame_hdr table will be created.
ld: warning: cannot find entry symbol _start; defaulting to 0000000008048320
Is it possible to run file compiled via android-ndk on a common linux x86 distribution?
No, the Android run-time libraries are not compatible with desktop Linux.
Note that your ndk-build puts the main executable in ./libs/x86/