Я пытаюсь добавить некоторый код opencv к файлам cptect-console-и detenet-camrea в учебнике по jetson-inference.
НО, когда я строю модель, она показывает мне следующую ошибку
[ 74%] Linking CXX executable ../aarch64/bin/detectnet-console
CMakeFiles/detectnet-console.dir/detectnet-console.cpp.o: In function cv::String::String(char const*)': detectnet-console.cpp:(.text._ZN2cv6StringC2EPKc[_ZN2cv6StringC5EPKc]+0x4c): undefined reference to cv::String::allocate(unsigned long)'
CMakeFiles/detectnet-console.dir/detectnet-console.cpp.o: In function cv::String::~String()': detectnet-console.cpp:(.text._ZN2cv6StringD2Ev[_ZN2cv6StringD5Ev]+0x10): undefined reference to cv::String::deallocate()'
CMakeFiles/detectnet-console.dir/detectnet-console.cpp.o: In function cv::Mat::Mat(int, int, int, void*, unsigned long)': detectnet-console.cpp:(.text._ZN2cv3MatC2EiiiPvm[_ZN2cv3MatC5EiiiPvm]+0x144): undefined reference to cv::error(int, cv::String const&, char const*, char const*, int)'
detectnet-console.cpp:(.text._ZN2cv3MatC2EiiiPvm[_ZN2cv3MatC5EiiiPvm]+0x258): undefined reference to cv::error(int, cv::String const&, char const*, char const*, int)' CMakeFiles/detectnet-console.dir/detectnet-console.cpp.o: In function cv::Mat::~Mat()':
detectnet-console.cpp:(.text._ZN2cv3MatD2Ev[_ZN2cv3MatD5Ev]+0x34): undefined reference to cv::fastFree(void*)' CMakeFiles/detectnet-console.dir/detectnet-console.cpp.o: In function cv::Mat::release()':
detectnet-console.cpp:(.text._ZN2cv3Mat7releaseEv[_ZN2cv3Mat7releaseEv]+0x58): undefined reference to `cv::Mat::deallocate()'
collect2: error: ld returned 1 exit status
detectnet-console/CMakeFiles/detectnet-console.dir/build.make:102: recipe for target 'aarch64/bin/detectnet-console' failed
make[2]: *** [aarch64/bin/detectnet-console] Error 1
CMakeFiles/Makefile2:235: recipe for target 'detectnet-console/CMakeFiles/detectnet-console.dir/all' failed
make[1]: *** [detectnet-console/CMakeFiles/detectnet-console.dir/all] Error 2
Makefile:127: recipe for target 'all' failed
make: *** [all] Error 2
который я искал для решения
и проблема при компиляции мне нужно добавить это
pkg-config opencv --cflags --libs
но я не знаю, к какой части cmake я должен добавить его.
любая помощь в этом вопросе