undefined reference to `__android_log_print'
原文:https://yfxuchao.iteye.com/blog/949198
原因:沒有加入支持的共享庫
出錯時:
Android.mk
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := testlog
LOCAL_SRC_FILES := testlog.c
include $(BUILD_SHARED_LIBRARY)
.c的頭文件
#include <string.h>
#include <jni.h>
#include <android/log.h>
調試好的:
Android.mk
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := testlog
LOCAL_SRC_FILES := testlog.c
LOCAL_LDLIBS := -llog
include $(BUILD_SHARED_LIBRARY)
.c的頭文件
#include <string.h>
#include <jni.h>
#include <android/log.h>
最後更新:2017-04-02 06:51:59