LBD_Descriptor icon indicating copy to clipboard operation
LBD_Descriptor copied to clipboard

Linking error

Open chaiein opened this issue 7 years ago • 1 comments

[100%] Linking CXX executable TestLineMatchingAlgorithm CMakeFiles/TestLineMatchingAlgorithm.dir/TestLineMatchingAlgorithm.cpp.o: In function main': TestLineMatchingAlgorithm.cpp:(.text.startup+0x101): undefined reference to cv::imread(cv::String const&, int)' TestLineMatchingAlgorithm.cpp:(.text.startup+0x211): undefined reference to cv::imread(cv::String const&, int)' TestLineMatchingAlgorithm.cpp:(.text.startup+0x877): undefined reference to cv::imwrite(cv::String const&, cv::_InputArray const&, std::vector<int, std::allocator > const&)' TestLineMatchingAlgorithm.cpp:(.text.startup+0x910): undefined reference to `cv::imwrite(cv::String const&, cv::_InputArray const&, std::vector<int, std::allocator > const&)' collect2: error: ld returned 1 exit status CMakeFiles/TestLineMatchingAlgorithm.dir/build.make:95: recipe for target 'TestLineMatchingAlgorithm' failed make[2]: *** [TestLineMatchingAlgorithm] Error 1 CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/TestLineMatchingAlgorithm.dir/all' failed make[1]: *** [CMakeFiles/TestLineMatchingAlgorithm.dir/all] Error 2 Makefile:83: recipe for target 'all' failed make: *** [all] Error 2

How to solve this problem?

chaiein avatar Mar 16 '17 11:03 chaiein

hello. I solved this problem by modifying the opencv version. Because I installed two versions of opencv,the one is opencv-2.4.9,the other one is opencv-3.1.0.

Resolvent:

Modify cmakelist.txt: add :set(OpenCV_DIR "/home/wj/opencv-3.1.0/build/") //this is your opencv-3.1.0's position find_package( OpenCV REQUIRED ) TARGET_LINK_LIBRARIES(LineMatchingLib ${OpenCV_LIBS} )

jessicajie avatar Sep 12 '17 03:09 jessicajie