在构建opencv时,从源代码编译ROS Kinetec失败

时间:2016-12-28 04:37:31

标签: opencv ros

我正在使用Arch机器并尝试从源代码编译 ROS桌面完整。当 image_proc 尝试链接可执行文件时,构建失败。

以下是错误日志:

[ 23%] Built target image_proc_gencfg
[ 84%] Built target image_proc
[ 92%] Linking CXX executable /home/alphayed/ROS/ros_catkin_ws/devel_isolated/image_proc/lib/image_proc/image_proc
/home/alphayed/ROS/ros_catkin_ws/install_isolated/lib/libopencv_viz3.so.3.1.0: undefined reference to `vtkSTLReader::New()'
/home/alphayed/ROS/ros_catkin_ws/install_isolated/lib/libopencv_viz3.so.3.1.0: undefined reference to `vtkOBJReader::New()'
collect2: error: ld returned 1 exit status
make[2]: *** [CMakeFiles/image_proc_exe.dir/build.make:219: /home/alphayed/ROS/ros_catkin_ws/devel_isolated/image_proc/lib/image_proc/image_proc] Error 1
make[1]: *** [CMakeFiles/Makefile2:68: CMakeFiles/image_proc_exe.dir/all] Error 2
make: *** [Makefile:139: all] Error 2

我认为问题与 opencv3 有关。我从系统中删除它并从源代码重新编译它,但这并没有解决问题。你能帮忙吗?

1 个答案:

答案 0 :(得分:0)

我已根据此thread找到了修复程序。您需要修改opencv3/cmake/OpenCVDetectVTK.cmake,为每个find_package(VTK QUIET COMPONENTS ...添加条目vtkIOGeometry