2

我正在尝试在同一个 mk 文件中编译 2 个共享库。第二个取决于第一个。我无法成功链接两者,第二个库看不到第一个库的 .h。

我可以将它们放在 LOCAL_C_INCLUDES 中,但是我想在 Android.mk 工作后对其进行拆分,并且我不能像这样进行硬引用。我发现 LOCAL_EXPORT_C_INCUDES 似乎完全符合我的要求......除了它不起作用。

这是我的代码

-------------------------------------------------- --------------------------

第一个图书馆

include $(CLEAR_VARS)
LOCAL_MODULE := libFirst
LOCAL_PATH_ORIG := $(LOCAL_PATH)
LOCAL_PATH := /the/path/to/my/first/sources
LOCAL_SRC_FILES = $(subst $(LOCAL_PATH)/,,$(wildcard $(LOCAL_PATH)/**/*.c))
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/include
LOCAL_CFLAGS := -g -O2
include $(BUILT_SHARED_LIBRARY)
LOCAL_PATH := $(LOCAL_PATH_ORIG)

-------------------------------------------------- --------------------------

第二图书馆

include $(CLEAR_VARS)
LOCAL_MODULE := libSecond
LOCAL_PATH_ORIG := $(LOCAL_PATH)
LOCAL_PATH := /the/path/to/my/second/sources
LOCAL_SRC_FILES := $(subst $(LOCAL_PATH)/,,$(wildcard $(LOCAL_PATH)/**/*.cpp))                                                                                                                       
LOCAL_C_INCLUDES :=     $(wildcard $(LOCAL_PATH)/**)                                                                                                                    
LOCAL_LDLIBS := -lGLESv2 -llibFirst
LOCAL_SHARED_LIBRARIES := libFirst                                                                                                    
include $(BUILD_SHARED_LIBRARY)
LOCAL_PATH := $(LOCAL_PATH_ORIG)

有任何想法吗 ?

4

1 回答 1

0

问题是这一行:

include $(BUILT_SHARED_LIBRARY)

A打错字了

include $(BUILD_SHARED_LIBRARY)

...

于 2012-07-05T09:52:19.297 回答