1.
Error
CMAKEFILES/OPENCV_EXAMPLE.DIR/EXAMPLE.CPP.O: In the function ' main ':
Example.cpp: (. text+0x12c): References not defined to ' cv::imshow (cv::string const&, Cv::_inputarray const&) '
Example.cpp: (. text+0x21d): References not defined to ' cv::imshow (cv::string const&, Cv::_inputarray const&) '
CMAKEFILES/OPENCV_EXAMPLE.DIR/EXAMPLE.CPP.O: In function ' DrawText (cv::mat&) ':
Example.cpp: (. text+0x3fe): To ' CV::p uttext (Cv::inputoutputarray const&, cv::string Const&, CV::P oint, int, Double, cv::scalar_, int, int, bool) ' undefined reference
CMAKEFILES/OPENCV_EXAMPLE.DIR/EXAMPLE.CPP.O: In function ' cv::string::string (char const*):
Example.cpp: (. text._zn2cv6stringc2epkc[_zn2cv6stringc5epkc]+0x4d): Reference not defined for ' cv::string::allocate (unsigned long) '
CMAKEFILES/OPENCV_EXAMPLE.DIR/EXAMPLE.CPP.O: In the function ' cv::string::~string () ':
Example.cpp: (. text._zn2cv6stringd2ev[_zn2cv6stringd5ev]+0x14): References not defined for ' cv::string::d eallocate () '
Collect2:error:ld returned 1 exit status
Cmakefiles/opencv_example.dir/build.make:112:recipe for Target ' opencv_example ' failed
MAKE[2]: * [opencv_example] Error 1
Cmakefiles/makefile2:67:recipe for Target ' Cmakefiles/opencv_example.dir/all ' failed
MAKE[1]: * [Cmakefiles/opencv_example.dir/all] Error 2
Makefile:83:recipe for target ' all ' failed
Make: * [All] Error 2
Error Analysis:
Find_package (OpenCV [version number] REQUIRED)
Cases
Find_package (OpenCV 3.3.0 REQUIRED)
Problems can be solved
The reason may be that it was accidentally changed to another version, causing the cmake to default to other versions and cannot find the library.
2.
Call the Include <opencv2/gpu/gpu.hpp>
/usr/include/opencv2/gpu/gpu.hpp:432:error: ' Vector ' does not Name a type
Cv_exports void merge (const vector& SRC, gpumat& dst, stream& Stream = Stream::null ());
Workaround:
at the front
Plus using namespace std