当我将Recovery从Android4.4.2移植到AndroidM时,我得到了__android_log_print
未定义的引用。这个问题存在,我也使用了我可以搜索的所有解决方案,但是他们没有&#39工作。
这是我的错误消息:
external / libpng / pngerror.c:50:错误:未定义引用' __ android_log_print'
这是我的Android.mk文件:
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_SRC_FILES := \
recovery.cpp \
bootloader.cpp \
install.cpp \
roots.cpp \
ui.cpp \
screen_ui.cpp \
verifier.cpp \
adb_install.cpp \
atc_update.cpp \
XMLFile.cpp
LOCAL_MODULE := recovery
LOCAL_FORCE_STATIC_EXECUTABLE := true
RECOVERY_API_VERSION := 3
LOCAL_CFLAGS += -DRECOVERY_API_VERSION=$(RECOVERY_API_VERSION)
LOCAL_STATIC_LIBRARIES := \
libext4_utils_static \
libsparse_static \
libminzip \
libz \
libmtdutils \
libmincrypt \
libminadbd \
libminui \
libpng \
libcutils \
libstdc++ \
libm \
libc
LOCAL_SHARED_LIBRARIES := libutils libcutils
LOCAL_LDLIBS += -llog
...
LOCAL_MODULE_TAGS := optional
LOCAL_C_INCLUDES += system/core/fs_mgr/include \
$(KERNEL_HEADERS) \
vendor/atc/proprietary/bootable/lk/platform/ac83xx/include \
system/extras/ext4_utils
LOCAL_C_INCLUDES += kernel/kernel-3.18/drivers/misc/atc/inc
include $(BUILD_EXECUTABLE)
这是external / libpng / pngerror.c:
...
#include <android/log.h>
#define LOGD(...) __android_log_print(ANDROID_LOG_DEBUG,TAG,__VA_ARGS__)
...
LOGD("png_error,msg:%s",error_message);
...
我也试过了LOCAL_LDLIBS += -L$(SYSROOT)/usr/lib -llog
,但它并没有解决问题。