这是opencv输出的文件夹结构
sdk
└── native
├── 3rdparty
│ └── libs
│ ├── arm64-v8a
│ │ ├── libcpufeatures.a
│ │ └── libtbb.a
│ ├── armeabi-v7a
│ │ ├── libcpufeatures.a
│ │ └── libtbb.a
│ ├── x86
│ │ ├── libcpufeatures.a
│ │ ├── libittnotify.a
│ │ └── libtbb.a
│ └── x86_64
│ ├── libcpufeatures.a
│ ├── libittnotify.a
│ └── libtbb.a
├── jni
│ ├── android.toolchain.cmake
│ ├── include
│ │ ├── opencv
│ │ │ ├── cvaux.h
| | | ...
│ │ └── opencv2
│ │ ├── core
└── libs
├── arm64-v8a
│ ├── libopencv_core.a
│ ├── libopencv_features2d.a
│ ├── libopencv_imgproc.a
│ └── libopencv_video.a
├── armeabi-v7a
│ ├── libopencv_core.a
│ ├── libopencv_features2d.a
│ ├── libopencv_imgproc.a
│ └── libopencv_video.a
├── x86
│ ├── libopencv_core.a
│ ├── libopencv_features2d.a
│ ├── libopencv_imgproc.a
│ └── libopencv_video.a
└── x86_64
├── libopencv_core.a
├── libopencv_features2d.a
├── libopencv_imgproc.a
└── libopencv_video.a
依赖项位于3rdparty文件夹中。 我创建了一个Android.mk文件,它使所有opencv库中的PREBUILD成为可能,但我不确定如何将依赖项添加到预构建模块中。这是我目前的Android.mk文件
ROOT_DIR := $(call my-dir)
LOCAL_PATH := $(ROOT_DIR)/core-libs/opencv/Android/sdk/native/libs
include $(CLEAR_VARS)
LOCAL_MODULE := opencv_core_prebuilt
LOCAL_MULTILIB := both
LOCAL_MODULE_CLASS := STATIC_LIBRARIES
LOCAL_MODULE_SUFFIX := .a
LOCAL_SRC_FILES_64 := arm64-v8a/libopencv_core.a
LOCAL_SRC_FILES_32 := armeabi-v7a/libopencv_core.a
LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/../jni/include
LOCAL_EXPORT_CFLAGS_64 := -L$(LOCAL_PATH)/../3rdparty/libs/arm64-v8a -llibtbb.a -llibcpufeatures.a
LOCAL_EXPORT_CFLAGS_32 := -L$(LOCAL_PATH)/../3rdparty/libs/armeabi-v7a -llibtbb.a -llibcpufeatures.a
include $(BUILD_PREBUILT)
include $(CLEAR_VARS)
LOCAL_MODULE := opencv_features2d_prebuilt
LOCAL_MULTILIB := both
LOCAL_MODULE_CLASS := STATIC_LIBRARIES
LOCAL_MODULE_SUFFIX := .a
LOCAL_SRC_FILES_64 := arm64-v8a/libopencv_features2d.a
LOCAL_SRC_FILES_32 := armeabi-v7a/libopencv_features2d.a
LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/../jni/include
include $(BUILD_PREBUILT)
include $(CLEAR_VARS)
LOCAL_MODULE := opencv_imgproc_prebuilt
LOCAL_MULTILIB := both
LOCAL_MODULE_CLASS := STATIC_LIBRARIES
LOCAL_MODULE_SUFFIX := .a
LOCAL_SRC_FILES_64 := arm64-v8a/libopencv_imgproc.a
LOCAL_SRC_FILES_32 := armeabi-v7a/libopencv_imgproc.a
LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/../jni/include
include $(BUILD_PREBUILT)
include $(CLEAR_VARS)
LOCAL_MODULE := opencv_video_prebuilt
LOCAL_MULTILIB := both
LOCAL_MODULE_CLASS := STATIC_LIBRARIES
LOCAL_MODULE_SUFFIX := .a
LOCAL_SRC_FILES_64 := arm64-v8a/libopencv_video.a
LOCAL_SRC_FILES_32 := armeabi-v7a/libopencv_video.a
LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/../jni/include
include $(BUILD_PREBUILT)
当我尝试链接到opencv prebuilds时,我得到了对libtbb调用的未定义引用。
如何指定libtbb依赖项以及如何确保相应的3rdparty .a文件链接在一起。
我可以将它添加到LOCAL_SRC_FILES变量吗?