我在android ndk eclipse中编译了glib库(用localgmib创建了一个libglib.so文件作为libglib)。但是我得到了could not be resolved errors
内置的glib功能。
这是我的android.mk文件:
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
include $(call all-subdir-makefiles)
LOCAL_LDLIBS := -llog
LOCAL_MODULE := mycode
LOCAL_SRC_FILES := mycode.c
LOCAL_SHARED_LIBRARIES := libglib
LOCAL_C_INCLUDES += $(LOCAL_PATH)/../glib/
LOCAL_C_INCLUDES += $(LOCAL_PATH)/../glib/glib/
include $(BUILD_SHARED_LIBRARY)
我错过了什么?
答案 0 :(得分:0)
我认为您必须将其更改为
LOCAL_SHARED_LIBRARIES := glib # for libglib.so
答案 1 :(得分:0)
我认为你的Android.mk应该是这样的:
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := libglib
LOCAL_SRC_FILES := ../glib/glib.c
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/../glib/
include $(BUILD_SHARED_LIBRARY)
include $(CLEAR_VARS)
LOCAL_MODULE := mycode
LOCAL_C_INCLUDES := $(LOCAL_PATH) \
$(LOCAL_PATH)/../glib/
LOCAL_SRC_FILES := mycode.c
LOCAL_LDLIBS := -llog
LOCAL_SHARED_LIBRARIES := libglib
include $(BUILD_SHARED_LIBRARY)
第一部分构建libglib.so
。
然后,您可以让模块mycode
依赖它。