首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 移动开发 > Android >

undefined reference to `android_log_print'

2012-09-29 
undefined reference to `__android_log_print原因:没有加入支持的共享库出错时:Android.mkLOCAL_PATH :

undefined reference to `__android_log_print'

原因:没有加入支持的共享库

出错时:

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>

热点排行