libopencv_highgui.so.3.2:添加符号时出错:命令行缺少DSO

时间:2019-09-10 15:37:04

标签: opencv cmake ros

当我尝试建立我的工作空间时,出现此错误:

CMakeFiles/openpose_ros_node_firephinx.dir/src/openpose_ros_node_firephinx.cpp.o: undefined reference to symbol '_ZN2cv7waitKeyEi'
//usr/local/lib/libopencv_highgui.so.3.2: error adding symbols: DSO missing from command line.

我尝试将OpenCV库手动添加到CMakeLists.txt文件中,但是问题仍然存在。

这就是我加入OpenCV的方式:

find_package(OpenCV REQUIRED PATHS /usr/local/share/OpenCV NO_DEFAULT_PATH)
include_directories(${OpenCV_INCLUDE_DIRS})

1 个答案:

答案 0 :(得分:0)

我在CMake文件的opencv_highgui中添加了target_link_libraries(),以解决该问题。