error: Android 5.0 and later only support position-independent executables (-fPIE)
ndk高版本编译成可执行文件出错
直接换成下面这个
#LOCAL_PATH := $(call my-dir)
#include $(CLEAR_VARS)
#LOCAL_ARM_MODE := arm #编译后的指令集 ARM指令
#LOCAL_MODULE := yijindaxue #模块名称
#LOCAL_SRC_FILES := yijindaxue.c #源文件 .c或者.cpp
#include $(BUILD_SHARED_LIBRARY) #指定编译文件的类型 include $(BUILD_SHARED_LIBRARY)
#include $(BUILD_EXECUTABLE)
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
# Enable PIE manually. Will get reset on $(CLEAR_VARS). This
# is what enabling PIE translates to behind the scenes.
LOCAL_CFLAGS += -fPIE
LOCAL_LDFLAGS += -fPIE -pie
LOCAL_MODULE := yijindaxue
LOCAL_SRC_FILES := \
yijindaxue.c
include $(BUILD_EXECUTABLE)
include $(CLEAR_VARS)
LOCAL_MODULE := yijindaxue-nopie
LOCAL_SRC_FILES := \
yijindaxue.c
include $(BUILD_EXECUTABLE)