Error while compiling rviz
Previously I was using rviz from sudo apt-get install ros-groovy-rviz
and it encounters some error when I trying to view laser data. So I decided to git clone it and compile the version 1.9.35 of rviz. However, when I catkin_make the rviz it shows me the error below
Linking CXX executable /home/viki/catkin_ws/devel/lib/rviz/rviz
[ 92%] Built target default_plugin
Linking CXX executable /home/viki/catkin_ws/devel/lib/rviz/image_view
/home/viki/catkin_ws/devel/lib/librviz.so: undefined reference to `image_transport::ImageTransport::~ImageTransport()'
/home/viki/catkin_ws/devel/lib/librviz.so: undefined reference to `image_transport::ImageTransport::ImageTransport(ros::NodeHandle const&)'
/home/viki/catkin_ws/devel/lib/librviz.so: undefined reference to `image_transport::ImageTransport::subscribe(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, unsigned int, boost::function<void (boost::shared_ptr<sensor_msgs::Image_<std::allocator<void> > const> const&)> const&, boost::shared_ptr<void> const&, image_transport::TransportHints const&)'
/home/viki/catkin_ws/devel/lib/librviz.so: undefined reference to `image_transport::Subscriber::shutdown()'
collect2: ld returned 1 exit status
make[2]: *** [/home/viki/catkin_ws/devel/lib/rviz/rviz] Error 1
make[1]: *** [rviz/src/rviz/CMakeFiles/executable.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
CMakeFiles/rviz_image_view.dir/image_view.cpp.o: In function `ImageView':
/home/viki/catkin_ws/src/rviz/src/image_view/image_view.cpp:56: undefined reference to `image_transport::ImageTransport::ImageTransport(ros::NodeHandle const&)'
/home/viki/catkin_ws/src/rviz/src/image_view/image_view.cpp:56: undefined reference to `image_transport::ImageTransport::~ImageTransport()'
CMakeFiles/rviz_image_view.dir/image_view.cpp.o: In function `~ImageView':
/home/viki/catkin_ws/src/rviz/src/image_view/image_view.cpp:62: undefined reference to `image_transport::ImageTransport::~ImageTransport()'
/home/viki/catkin_ws/src/rviz/src/image_view/image_view.cpp:62: undefined reference to `image_transport::ImageTransport::~ImageTransport()'
CMakeFiles/rviz_image_view.dir/image_view.cpp.o: In function `image_transport::SubscriberFilter::subscribe(image_transport::ImageTransport&, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, unsigned int, image_transport::TransportHints const&)':
/opt/ros/groovy/include/image_transport/subscriber_filter.h:111: undefined reference to `image_transport::ImageTransport::subscribe(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, unsigned int, boost::function<void (boost::shared_ptr<sensor_msgs::Image_<std::allocator<void> > const> const&)> const&, boost::shared_ptr<void> const&, image_transport::TransportHints const&)'
CMakeFiles/rviz_image_view.dir/image_view.cpp.o: In function `image_transport::SubscriberFilter::unsubscribe()':
/opt/ros/groovy/include/image_transport/subscriber_filter.h:119: undefined reference to `image_transport::Subscriber::shutdown()'
collect2: ld returned 1 exit status
make[2]: *** [/home/viki/catkin_ws/devel/lib/rviz/image_view] Error 1
make[1]: *** [rviz/src/image_view/CMakeFiles/rviz_image_view.dir/all] Error 2
make: *** [all] Error 2
Invoking "make" failed
At first I thought it was something to do with the image_transport package and so after I do source /opt/ros/groovy/setup.bash
, I can rosrun image_transport but the error still remain the same. Do anyone know how to solve it? Thank you.