gpt4 book ai didi

android - Qt Android 项目与 OpenCV - tbb 编译错误

转载 作者:太空宇宙 更新时间:2023-11-03 10:25:57 25 4
gpt4 key购买 nike

我想用 OpenCV 创建一个 Qt Android 应用程序。我在 Ubuntu 12.04(64 位)上使用 Necessitas Qt Creator 和 OpenCV 2.4.0 Android 二进制包。目前我只是创建了一个 OpenCV Mat 对象。

但是当我编译项目时,我得到一些关于 tbb 函数的“ undefined reference ”错误:

> /home/kolbe/src/android-sdk-linux/OpenCV-2.4.0/libs/armeabi-v7a/libopencv_core.a(stat.cpp.o):-1: In function tbb::interface6::internal::start_for<tbb::blocked_range<int>, cv::BatchDistInvoker, tbb::auto_partitioner>::execute():
stat.cpp:-1: error: undefined reference to tbb::internal::allocate_continuation_proxy::allocate(unsigned int) const
stat.cpp:-1: error: undefined reference to tbb::internal::allocate_continuation_proxy::allocate(unsigned int) const
...

我在我的 *.pro/qmake 文件中包含了 OpenCV 库(还有 libtbb.a):

ANDROID_OPENCV = /home/kolbe/src/android-sdk-linux/OpenCV-2.4.0
LIBS += \
$$ANDROID_OPENCV/libs/armeabi-v7a/libopencv_calib3d.a \
$$ANDROID_OPENCV/libs/armeabi-v7a/libopencv_flann.a \
$$ANDROID_OPENCV/libs/armeabi-v7a/libopencv_objdetect.a \
$$ANDROID_OPENCV/libs/armeabi-v7a/libopencv_contrib.a \
$$ANDROID_OPENCV/libs/armeabi-v7a/libopencv_video.a \
$$ANDROID_OPENCV/libs/armeabi-v7a/libopencv_ml.a \
$$ANDROID_OPENCV/libs/armeabi-v7a/libopencv_legacy.a \
$$ANDROID_OPENCV/libs/armeabi-v7a/libopencv_highgui.a \
$$ANDROID_OPENCV/share/OpenCV/3rdparty/libs/armeabi-v7a/liblibjpeg.a \
$$ANDROID_OPENCV/share/OpenCV/3rdparty/libs/armeabi-v7a/liblibpng.a \
$$ANDROID_OPENCV/share/OpenCV/3rdparty/libs/armeabi-v7a/liblibtiff.a \
$$ANDROID_OPENCV/share/OpenCV/3rdparty/libs/armeabi-v7a/liblibjasper.a \
$$ANDROID_OPENCV/share/OpenCV/3rdparty/libs/armeabi-v7a/libtbb.a \
$$ANDROID_OPENCV/libs/armeabi-v7a/libopencv_ts.a \
$$ANDROID_OPENCV/libs/armeabi-v7a/libopencv_imgproc.a \
$$ANDROID_OPENCV/libs/armeabi-v7a/libopencv_core.a \
$$ANDROID_OPENCV/libs/armeabi-v7a/libopencv_androidcamera.a \
$$ANDROID_OPENCV/libs/armeabi-v7a/libopencv_features2d.a

INCLUDEPATH += $$ANDROID_OPENCV/include/opencv/
INCLUDEPATH += $$ANDROID_OPENCV/include/opencv2/
INCLUDEPATH += $$ANDROID_OPENCV/include/

CONFIG+=link_pkgconfig PKGCONFIG+=opencv

为什么 OpenCV 找不到 tbb 函数?谢谢!

最佳答案

库的顺序对于链接很重要。尝试按以下方式重新排序行:

LIBS += \
$$ANDROID_OPENCV/libs/armeabi-v7a/libopencv_contrib.a \
$$ANDROID_OPENCV/libs/armeabi-v7a/libopencv_legacy.a \
$$ANDROID_OPENCV/libs/armeabi-v7a/libopencv_ml.a \
$$ANDROID_OPENCV/libs/armeabi-v7a/libopencv_objdetect.a \
$$ANDROID_OPENCV/libs/armeabi-v7a/libopencv_calib3d.a \
$$ANDROID_OPENCV/libs/armeabi-v7a/libopencv_video.a \
$$ANDROID_OPENCV/libs/armeabi-v7a/libopencv_features2d.a \
$$ANDROID_OPENCV/libs/armeabi-v7a/libopencv_highgui.a \
$$ANDROID_OPENCV/libs/armeabi-v7a/libopencv_androidcamera.a \
$$ANDROID_OPENCV/libs/armeabi-v7a/libopencv_flann.a \
$$ANDROID_OPENCV/libs/armeabi-v7a/libopencv_imgproc.a \
$$ANDROID_OPENCV/libs/armeabi-v7a/libopencv_core.a \
$$ANDROID_OPENCV/share/OpenCV/3rdparty/libs/armeabi-v7a/liblibjpeg.a \
$$ANDROID_OPENCV/share/OpenCV/3rdparty/libs/armeabi-v7a/liblibpng.a \
$$ANDROID_OPENCV/share/OpenCV/3rdparty/libs/armeabi-v7a/liblibtiff.a \
$$ANDROID_OPENCV/share/OpenCV/3rdparty/libs/armeabi-v7a/liblibjasper.a \
$$ANDROID_OPENCV/share/OpenCV/3rdparty/libs/armeabi-v7a/libtbb.a

关于android - Qt Android 项目与 OpenCV - tbb 编译错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12583590/

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