line_det.cpp:(.text+0x1299):对‘cv::imshow(cv::String const&, cv::_InputArray const&)’未定义的引用 l

Posted 振华OPPO

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了line_det.cpp:(.text+0x1299):对‘cv::imshow(cv::String const&, cv::_InputArray const&)’未定义的引用 l相关的知识,希望对你有一定的参考价值。

/usr/bin/ld: warning: libmysqlclient.so.20, needed by //usr/lib/libgdal.so.20, not found (try using -rpath or -rpath-link)
CMakeFiles/line.dir/src/line_det.cpp.o:在函数‘imageCallback(boost::shared_ptr<sensor_msgs::Image_<std::allocator > const> const&)’中:
line_det.cpp:(.text+0x1299):对‘cv::imshow(cv::String const&, cv::_InputArray const&)’未定义的引用
line_det.cpp:(.text+0x12c1):对‘cv::waitKey(int)’未定义的引用
CMakeFiles/line.dir/src/line_det.cpp.o:在函数‘main’中:
line_det.cpp:(.text+0x19c2):对‘cv::namedWindow(cv::String const&, int)’未定义的引用
line_det.cpp:(.text+0x1a00):对‘cv::resizeWindow(cv::String const&, int, int)’未定义的引用


打开功能包的CMakeLists.txt文件,在文件中添加opencv库:

find_package(OpenCV REQUIRED)


然后在生成节点时也添加opencv库:

target_link_libraries(xxxx $catkin_LIBRARIES $OpenCV_LIBRARIES)


重新编译项目,就可以成功!

以上是关于line_det.cpp:(.text+0x1299):对‘cv::imshow(cv::String const&, cv::_InputArray const&)’未定义的引用 l的主要内容,如果未能解决你的问题,请参考以下文章