gpt4 book ai didi

Android.mk 包含预建库

转载 作者:行者123 更新时间:2023-11-29 16:45:22 48 4
gpt4 key购买 nike

我正在努力获取一个模块以在 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/

48 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com