Ask Your Question
0

Compiling ROS Kinetec from source fails when building image_proc

asked 2016-12-27 22:57:24 -0500

alphayed gravatar image

updated 2016-12-30 16:08:40 -0500

I'm using an Arch machine and trying to compile ROS desktop full from source. The build fails when image_proc is trying to link executable.

Here is the error log:

[ 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

I think the problem is related to opencv3. I removed it from the system and recompiled it from source but that didn't solve the issue. Can you please help?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2017-01-08 19:13:40 -0500

ZOU Lu gravatar image

updated 2017-01-08 19:13:55 -0500

modify opencv3/cmake/OpenCVDetectVTK.cmake, for every find_package(VTK QUIET COMPONENTS ... add an entry vtkIOGeometry

This works for me

edit flag offensive delete link more

Comments

Thank you, that worked. Can you please explain what this fix does if you don't mind?

alphayed gravatar imagealphayed ( 2017-01-08 23:00:21 -0500 )edit

I suppose vtk has changed its structure in the new version, e.g. move vtkOBJReader into a sub library vtkIOGeometry, so you have to tell cmake to find vtkIOGeometry if you want to use that class.

Arch always uses the newest, that's why you'll encounter such issue earlier than others.

ZOU Lu gravatar imageZOU Lu ( 2017-01-09 08:51:58 -0500 )edit

BTW, I hate vtk, they love to change things, always like playing a solo

ZOU Lu gravatar imageZOU Lu ( 2017-01-09 08:53:19 -0500 )edit

I hear you vtk has been causing me lots of issues during this build.

alphayed gravatar imagealphayed ( 2017-01-09 15:29:13 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2016-12-27 22:51:39 -0500

Seen: 250 times

Last updated: Jan 08 '17