error: undefined reference to `cv::imread(cv::String const&, int)' 解決方法
阿新 • • 發佈:2019-02-09
編譯時出現下列錯誤:
undefined reference to 'cv::imread(cv::String const&, int)'
undefined reference to 'cv::String::deallocate()'
undefined reference to 'cv::imread(cv::String const&, int)'
undefined reference to 'cv::String::deallocate()'
undefined reference to 'cv::String::allocate(unsigned long)'
undefined reference to 'cv::String::allocate(unsigned long)'
undefined reference to 'cv::String::deallocate()'
undefined reference to 'cv::String::deallocate()'
解決方法:在CMakeLists.txt加入安裝OpenCV的版本號:
將
find_package( OpenCV REQUIRED )
更改為
find_package( OpenCV 3 REQUIRED )
。