我正在尝试将使用NDK生成的.so
链接到我正在尝试创建的新.so
,因为旧的.so
包含我的函数定义想要在新的.so
中使用。
答案 0 :(得分:1)
在Android.mk
中使用这样的内容应该这样做:
# Use the sub library as a prebuilt shared library
include $(CLEAR_VARS)
LOCAL_MODULE := MySubLibrary
LOCAL_SRC_FILES = /path/to/sub/library.so
LOCAL_EXPORT_C_INCLUDES := /path/to/sub/library/includes
include $(PREBUILT_SHARED_LIBRARY)
# Build your own library referencing your sub library
include $(CLEAR_VARS)
LOCAL_MODULE := MyFinalLibrary
LOCAL_SHARED_LIBRARIES := MySubLibrary
# Add your source files etc here...
include $(BUILD_SHARED_LIBRARY)
希望这有帮助!