作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在努力获取一个模块以在 Android 上编译。它引用了一个已经存在的共享库——我只有 .so 和 .h 文件。
我当前的 Android.mk 如下所示:
LOCAL_PATH:= $(call my-dir)
EXEC_ARCH := armeabi-v7a
local_vendorlib_c_includes := $(LOCAL_PATH)/VENDORLIB/include
# VENDORLIBWrapper library
include $(CLEAR_VARS)
LOCAL_MODULE_CLASS := SHARED_LIBRARIES
LOCAL_SRC_FILES := mylib.cpp
LOCAL_MODULE:= libvendorwrapper
LOCAL_MODULE_TAGS := optional
LOCAL_MODULE_PATH := $(TARGET_OUT_SHARED_LIBRARIES)/soundfx
LOCAL_LDLIBS := -L$(LOCAL_PATH)/DPS/$(EXEC_ARCH)/
LOCAL_C_INCLUDES := \
$(call include-path-for, graphics corecg) \
$(call include-path-for, audio-effects) \
$(local_dps_c_includes)
LOCAL_CPPFLAGS += -O2 -Wno-unused-parameter
#--verbose
LOCAL_SHARED_LIBRARIES := \
libcutils \
libdl \
libVendorLib
#LOCAL_PREBUILT_LIBS += libVendorLib
LOCAL_REQUIRED_MODULES := libVendorLib
include $(BUILD_SHARED_LIBRARY)
include $(CLEAR_VARS)
LOCAL_MODULE_CLASS := SHARED_LIBRARIES
LOCAL_MODULE := libVendorLib
LOCAL_SRC_FILES := $(LOCAL_PATH)/VendorLib/$(EXEC_ARCH)/libVendorLib.so
LOCAL_MODULE_TAGS := debug
LOCAL_EXPORT_C_INCLUDES := $(local_vendorlib_c_includes)
include $(PREBUILT_SHARED_LIBRARY)
include $(call all-makefiles-under,$(LOCAL_PATH))
我收到以下错误:
> ninja: error:
> 'out/target/product/generic/obj/lib/libVendorLib.so.toc', needed by
> 'out/target/product/generic/obj/SHARED_LIBRARIES/libvendorwrapper_intermediates/LINKED/libvendorwrapper.so', missing and no known rule to make it make: *** [ninja_wrapper] Error 1
> make: Leaving directory `/home/donatoaz/WORKING_DIRECTORY'
>
> #### make failed to build some targets (23 seconds) ####
最佳答案
我终于能够通过进行以下更改来构建它
我能够通过以下更改构建它:
include $(CLEAR_VARS)
LOCAL_MODULE_CLASS := SHARED_LIBRARIES
LOCAL_MODULE := libVendorLib
LOCAL_SRC_FILES := libVendorLib.so # <== Moved the prebuilt lib to root / -- oddly enough, when it was in a subfolder, make would not find it.
LOCAL_MODULE_TAGS := debug
LOCAL_EXPORT_C_INCLUDES := $(local_vendorlib_c_includes)
include $(BUILD_PREBUILT) # <== changed this from PREBUILT_SHARED_LIBRARY
现在我得到:
make completed successfully (21 seconds)
关于Android.mk 包含预建库,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48651798/
我是一名优秀的程序员,十分优秀!