日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

Clion:undefined reference to `cv::noArray()解决方案

發布時間:2023/12/20 编程问答 34 豆豆
生活随笔 收集整理的這篇文章主要介紹了 Clion:undefined reference to `cv::noArray()解决方案 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

完整問題復現如下:

====================[ Build | GaussNewton | Debug ]============================= /usr/local/bin/cmake --build /home/appleyuchi/CLionProjects/GaussNewton/cmake-build-debug --target GaussNewton -- -j 4 OpenCV_LIBS: opencv_calib3dopencv_coreopencv_dnnopencv_features2dopencv_flannopencv_gapiopencv_highguiopencv_imgcodecsopencv_imgprocopencv_mlopencv_objdetectopencv_photoopencv_stitchingopencv_videoopencv_videoioopencv_arucoopencv_bgsegmopencv_bioinspiredopencv_ccalibopencv_datasetsopencv_dnn_objdetectopencv_dpmopencv_faceopencv_freetypeopencv_fuzzyopencv_hfsopencv_img_hashopencv_line_descriptoropencv_optflowopencv_phase_unwrappingopencv_plotopencv_regopencv_rgbdopencv_saliencyopencv_shapeopencv_stereoopencv_structured_lightopencv_superresopencv_surface_matchingopencv_textopencv_trackingopencv_videostabopencv_xfeatures2dopencv_ximgprocopencv_xobjdetectopencv_xphoto -- Configuring done -- Generating done -- Build files have been written to: /home/appleyuchi/CLionProjects/GaussNewton/cmake-build-debug [ 50%] Building CXX object CMakeFiles/GaussNewton.dir/main.cpp.o [100%] Linking CXX executable GaussNewton /usr/bin/ld: CMakeFiles/GaussNewton.dir/main.cpp.o: in function `cv::operator+=(cv::Mat&, cv::Mat const&)': /home/appleyuchi/opencv/opencv_install/include/opencv4/opencv2/core/operations.hpp:261: undefined reference to `cv::noArray()' /usr/bin/ld: /home/appleyuchi/opencv/opencv_install/include/opencv4/opencv2/core/operations.hpp:261: undefined reference to `cv::add(cv::_InputArray const&, cv::_InputArray const&, cv::_OutputArray const&, cv::_InputArray const&, int)' /usr/bin/ld: CMakeFiles/GaussNewton.dir/main.cpp.o: in function `GaussNewton(double (*)(cv::Mat const&, cv::Mat), cv::Mat const&, cv::Mat const&, cv::Mat)': /home/appleyuchi/CLionProjects/GaussNewton/main.cpp:119: undefined reference to `cv::Mat::t() const' /usr/bin/ld: /home/appleyuchi/CLionProjects/GaussNewton/main.cpp:119: undefined reference to `cv::Mat::t() const' /usr/bin/ld: /home/appleyuchi/CLionProjects/GaussNewton/main.cpp:119: undefined reference to `cv::operator*(cv::MatExpr const&, cv::Mat const&)' /usr/bin/ld: /home/appleyuchi/CLionProjects/GaussNewton/main.cpp:119: undefined reference to `cv::MatExpr::inv(int) const' /usr/bin/ld: /home/appleyuchi/CLionProjects/GaussNewton/main.cpp:119: undefined reference to `cv::operator*(cv::MatExpr const&, cv::MatExpr const&)' /usr/bin/ld: /home/appleyuchi/CLionProjects/GaussNewton/main.cpp:119: undefined reference to `cv::operator*(cv::MatExpr const&, cv::Mat const&)' /usr/bin/ld: CMakeFiles/GaussNewton.dir/main.cpp.o: in function `cv::Mat::Mat(cv::Mat const&)': /home/appleyuchi/opencv/opencv_install/include/opencv4/opencv2/core/mat.inl.hpp:538: undefined reference to `cv::Mat::copySize(cv::Mat const&)' /usr/bin/ld: CMakeFiles/GaussNewton.dir/main.cpp.o: in function `cv::Mat::~Mat()': /home/appleyuchi/opencv/opencv_install/include/opencv4/opencv2/core/mat.inl.hpp:739: undefined reference to `cv::fastFree(void*)' /usr/bin/ld: CMakeFiles/GaussNewton.dir/main.cpp.o: in function `cv::Mat::clone() const': /home/appleyuchi/opencv/opencv_install/include/opencv4/opencv2/core/mat.inl.hpp:811: undefined reference to `cv::Mat::copyTo(cv::_OutputArray const&) const' /usr/bin/ld: CMakeFiles/GaussNewton.dir/main.cpp.o: in function `cv::Mat::create(int, int, int)': /home/appleyuchi/opencv/opencv_install/include/opencv4/opencv2/core/mat.inl.hpp:831: undefined reference to `cv::Mat::create(int, int const*, int)' /usr/bin/ld: CMakeFiles/GaussNewton.dir/main.cpp.o: in function `cv::Mat::release()': /home/appleyuchi/opencv/opencv_install/include/opencv4/opencv2/core/mat.inl.hpp:851: undefined reference to `cv::Mat::deallocate()' collect2: error: ld returned 1 exit status make[3]: *** [CMakeFiles/GaussNewton.dir/build.make:84: GaussNewton] Error 1 make[2]: *** [CMakeFiles/Makefile2:76: CMakeFiles/GaussNewton.dir/all] Error 2 make[1]: *** [CMakeFiles/Makefile2:83: CMakeFiles/GaussNewton.dir/rule] Error 2 make: *** [Makefile:118: GaussNewton] Error 2

解決方案:
CMakeLists.txt

cmake_minimum_required(VERSION 3.12) project(GaussNewton)set(CMAKE_CXX_STANDARD 14) include_directories($ENV{CMAKE_INCLUDE_PATH}) set(CMAKE_CXX_STANDARD 14)#C++ standard set(OpenCV_DIR /home/appleyuchi/opencv/opencv_install/lib/cmake/opencv4) find_package( OpenCV REQUIRED ) # locate OpenCV in systeminclude_directories( ${OpenCV_INCLUDE_DIRS} ) # provide library headersadd_executable(GaussNewton main.cpp) #target_link_libraries(GaussNewton ${OpenCV_LIBS} /home/appleyuchi/opencv/opencv_install/lib/libopencv_highgui.so) # link OpenCV libraries , hightgui.so not found by cmake so this hack MESSAGE("OpenCV_LIBS: " ${OpenCV_LIBS} ) #display opencv libs found

總結

以上是生活随笔為你收集整理的Clion:undefined reference to `cv::noArray()解决方案的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。