静态库的未定义引用

时间:2011-03-31 13:35:30

标签: android android-ndk android-ndk-r5

我有3个静态库。我试图将它们与a链接起来 共享库,但我得到了大量未定义的引用。 提到静态库也很重要 依赖关系。

这是我想要做的一个例子

##### STATIC #####

LOCAL_PATH := $(call my-dir)

include $(CLEAR_VARS)
LOCAL_MODULE := A
LOCAL_SRC_FILES := libA.a
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/A/include
LOCAL_STATIC_LIBRARIES := C B
include $(PREBUILT_STATIC_LIBRARY)

include $(CLEAR_VARS)
LOCAL_MODULE := B
LOCAL_SRC_FILES := libB.a
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/B/Include
LOCAL_STATIC_LIBRARIES := C
include $(PREBUILT_STATIC_LIBRARY)

include $(CLEAR_VARS)
LOCAL_MODULE := C
LOCAL_SRC_FILES := libC.a
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/C/Include
include $(PREBUILT_STATIC_LIBRARY)

##### SHARED #####
include $(CLEAR_VARS)

LOCAL_MODULE := D

LOCAL_SRC_FILES += d.cpp

LOCAL_C_INCLUDES := $(LOCAL_PATH)/D/Include
LOCAL_C_INCLUDES += $(LOCAL_PATH)/A/Include
LOCAL_C_INCLUDES += $(LOCAL_PATH)/B/Include
LOCAL_C_INCLUDES += $(LOCAL_PATH)/C/Include

LOCAL_STATIC_LIBRARIES := A B C

include $(BUILD_SHARED_LIBRARY) 

当我尝试构建时,我会得到大量未定义的内容 refrences。如果有人有任何想法,将不胜感激, 我把头发拉出来了!

0 个答案:

没有答案