этапе линковки с приложением сыпятся такие ошибки линковки:
[build] /usr/bin/ld: CMakeFiles/capture.dir/src/vpb/vpb.cpp.o: in function `vpb::vpb::frame_handler(std::span<std::byte, 18446744073709551615ul>)':
[build] vpb.cpp:(.text+0x35c): undefined reference to `cv::legacy::tracking::Tracker::update(cv::_InputArray const&, cv::Rect_<double>&)'
[build] /usr/bin/ld: vpb.cpp:(.text+0x480): undefined reference to `cv::legacy::tracking::TrackerMedianFlow::create()'
[build] /usr/bin/ld: vpb.cpp:(.text+0x5c4): undefined reference to `cv::legacy::tracking::Tracker::init(cv::_InputArray const&, cv::Rect_<double> const&)'
[build] /usr/bin/ld: CMakeFiles/capture.dir/src/vpb/vpb.cpp.o: in function `tracking::opencv_tracker<cv::legacy::tracking::TrackerMedianFlow>::update(cv::Mat const&)':
[build] vpb.cpp:(.text._ZN8tracking14opencv_trackerIN2cv6legacy8tracking17TrackerMedianFlowEE6updateERKNS1_3MatE[_ZN8tracking14opencv_trackerIN2cv6legacy8tracking17TrackerMedianFlowEE6updateERKNS1_3MatE]+0x90): undefined reference to `cv::legacy::tracking::Tracker::update(cv::_InputArray const&, cv::Rect_<double>&)'
[build] /usr/bin/ld: CMakeFiles/capture.dir/src/vpb/vpb.cpp.o: in function `tracking::opencv_tracker<cv::legacy::tracking::TrackerMedianFlow>::init(cv::Mat const&, cv::Rect_<double> const&)':
[build] vpb.cpp:(.text._ZN8tracking14opencv_trackerIN2cv6legacy8tracking17TrackerMedianFlowEE4initERKNS1_3MatERKNS1_5Rect_IdEE[_ZN8tracking14opencv_trackerIN2cv6legacy8tracking17TrackerMedianFlowEE4initERKNS1_3MatERKNS1_5Rect_IdEE]+0x24): undefined reference to `cv::legacy::tracking::TrackerMedianFlow::create()'
[build] /usr/bin/ld: vpb.cpp:(.text._ZN8tracking14opencv_trackerIN2cv6legacy8tracking17TrackerMedianFlowEE4initERKNS1_3MatERKNS1_5Rect_IdEE[_ZN8tracking14opencv_trackerIN2cv6legacy8tracking17TrackerMedianFlowEE4initERKNS1_3MatERKNS1_5Rect_IdEE]+0x158): undefined reference to `cv::legacy::tracking::Tracker::init(cv::_InputArray const&, cv::Rect_<double> const&)'
[build] collect2: error: ld returned 1 exit status
Конфиг сборки вот такой:
cmake -DBUILD_LIST=core,imgproc,imgcodecs,video,videoio,features2d -DOPENCV_EXTRA_MODULES_PATH=../opencv_contrib/modules/optflow\;../opencv_contrib/modules/plot\;../opencv_contrib/modules/tracking -DCMAKE_BUILD_TYPE=RELEASE -DBUILD_SHARED_LIBS=OFF -DOPENCV_GENERATE_PKGCONFIG=ON -DBUILD_TESTS=OFF -DBUILD_PERF_TESTS=OFF -DBUILD_EXAMPLES=OFF -DENABLE_LTO=ON -DWITH_IMGCODEC_HDR=OFF -DWITH_IMGCODEC_SUNRASTER=OFF -DWITH_IMGCODEC_PXM=OFF -DWITH_IMGCODEC_PFM=OFF -DWITH_TIFF=OFF -DWITH_WEBP=OFF -DWITH_OPENJPEG=OFF -DWITH_JASPER=OFF -DWITH_OPENEXR=OFF -DWITH_FFMPEG=ON -DWITH_GSTREAMER=ON -DWITH_1394=OFF -DWITH_EIGEN=ON -DWITH_PROTOBUF=OFF -DCMAKE_INSTALL_PREFIX=/usr/local -DENABLE_CCACHE=ON -DBUILD_JAVA=OFF -DBUILD_opencv_python2=OFF -DBUILD_opencv_python3=OFF -DENABLE_NEON=ON -DENABLE_FAST_MATH=ON -DBUILD_opencv_apps=OFF -DENABLE_PIC=OFF -DWITH_QUIRC=OFF -DWITH_ADE=OFF -DCMAKE_CXX_FLAGS="-fvisibility=hidden -fvisibility-inlines-hidden -ffunction-sections -fdata-sections" ../opencv
Вот тут конфигурация:
https://pastebin.com/D6kMabDK
Сталкивался кто-нибудь с подобным?
А почему tracking и другие не добавлены в build list?
Спасибо за внимание, уже решил проблему. Оказывается, модуль tracking косвенно зависит от calib3d, flann и пары других основных модулей. С их включением все решилось
Обсуждают сегодня