rtabmap_ros icon indicating copy to clipboard operation
rtabmap_ros copied to clipboard

catkin_make error

Open chukhoi61 opened this issue 1 year ago • 1 comments

hello, i have this error

[ 87%] Built target rtabmap_rgbd_split [ 87%] Building CXX object rtabmap_ros/rtabmap_util/CMakeFiles/rtabmap_map_optimizer.dir/src/MapOptimizerNode.cpp.o /usr/bin/ld: /usr/local/lib/librtabmap_core.so.0.21.4: undefined reference to g2o::OptimizableGraph::Edge::clone() const' /usr/bin/ld: /usr/local/lib/librtabmap_core.so.0.21.4: undefined reference to g2o::OptimizableGraph::Vertex::clone() const' /usr/bin/ld: /usr/local/lib/librtabmap_core.so.0.21.4: undefined reference to g2o::VertexSBAPointXYZ::VertexSBAPointXYZ()' /usr/bin/ld: /usr/local/lib/librtabmap_core.so.0.21.4: undefined reference to octomath::Pose6D::Pose6D(octomath::Pose6D const&)' /usr/bin/ld: /usr/local/lib/librtabmap_core.so.0.21.4: undefined reference to g2o::Factory::registerType(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, g2o::AbstractHyperGraphElementCreator*)' collect2: error: ld returned 1 exit status make[2]: *** [rtabmap_ros/rtabmap_demos/CMakeFiles/rtabmap_wifi_signal_pub.dir/build.make:365: /home/chukhoi/catkin_ws/devel/lib/rtabmap_demos/wifi_signal_pub] Error 1 make[1]: *** [CMakeFiles/Makefile2:8703: rtabmap_ros/rtabmap_demos/CMakeFiles/rtabmap_wifi_signal_pub.dir/all] Error 2 make[1]: *** Waiting for unfinished jobs.... /usr/bin/ld: /usr/local/lib/librtabmap_core.so.0.21.4: undefined reference to g2o::OptimizableGraph::Edge::clone() const' /usr/bin/ld: /usr/local/lib/librtabmap_core.so.0.21.4: undefined reference to g2o::OptimizableGraph::Vertex::clone() const' /usr/bin/ld: /usr/local/lib/librtabmap_core.so.0.21.4: undefined reference to g2o::VertexSBAPointXYZ::VertexSBAPointXYZ()' /usr/bin/ld: /usr/local/lib/librtabmap_core.so.0.21.4: undefined reference to octomath::Pose6D::Pose6D(octomath::Pose6D const&)' /usr/bin/ld: /usr/local/lib/librtabmap_core.so.0.21.4: undefined reference to g2o::Factory::registerType(std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&, g2o::AbstractHyperGraphElementCreator*)' collect2: error: ld returned 1 exit status make[2]: *** [rtabmap_ros/rtabmap_demos/CMakeFiles/rtabmap_wifi_signal_sub.dir/build.make:365: /home/chukhoi/catkin_ws/devel/lib/rtabmap_demos/wifi_signal_sub] Error 1 make[1]: *** [CMakeFiles/Makefile2:8729: rtabmap_ros/rtabmap_demos/CMakeFiles/rtabmap_wifi_signal_sub.dir/all] Error 2 /usr/bin/ld: /usr/local/lib/librtabmap_core.so.0.21.4: undefined reference to g2o::OptimizableGraph::Edge::clone() const' /usr/bin/ld: /usr/local/lib/librtabmap_core.so.0.21.4: undefined reference to g2o::OptimizableGraph::Vertex::clone() const' /usr/bin/ld: /usr/local/lib/librtabmap_core.so.0.21.4: undefined reference to g2o::VertexSBAPointXYZ::VertexSBAPointXYZ()' /usr/bin/ld: /usr/local/lib/librtabmap_core.so.0.21.4: undefined reference to octomath::Pose6D::Pose6D(octomath::Pose6D const&)' /usr/bin/ld: /usr/local/lib/librtabmap_core.so.0.21.4: undefined reference to g2o::Factory::registerType(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, g2o::AbstractHyperGraphElementCreator*)' collect2: error: ld returned 1 exit status make[2]: *** [rtabmap_ros/rtabmap_demos/CMakeFiles/rtabmap_save_objects_example.dir/build.make:572: /home/chukhoi/catkin_ws/devel/lib/rtabmap_demos/save_objects_example] Error 1 make[1]: *** [CMakeFiles/Makefile2:8755: rtabmap_ros/rtabmap_demos/CMakeFiles/rtabmap_save_objects_example.dir/all] Error 2 [ 87%] Linking CXX executable /home/chukhoi/catkin_ws/devel/lib/rtabmap_util/map_optimizer /usr/bin/ld: /usr/local/lib/librtabmap_core.so.0.21.4: undefined reference to g2o::OptimizableGraph::Edge::clone() const' /usr/bin/ld: /usr/local/lib/librtabmap_core.so.0.21.4: undefined reference to g2o::OptimizableGraph::Vertex::clone() const' /usr/bin/ld: /usr/local/lib/librtabmap_core.so.0.21.4: undefined reference to g2o::VertexSBAPointXYZ::VertexSBAPointXYZ()' /usr/bin/ld: /usr/local/lib/librtabmap_core.so.0.21.4: undefined reference to octomath::Pose6D::Pose6D(octomath::Pose6D const&)' /usr/bin/ld: /usr/local/lib/librtabmap_core.so.0.21.4: undefined reference to g2o::Factory::registerType(std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&, g2o::AbstractHyperGraphElementCreator*)' collect2: error: ld returned 1 exit status make[2]: *** [rtabmap_ros/rtabmap_util/CMakeFiles/rtabmap_map_optimizer.dir/build.make:396: /home/chukhoi/catkin_ws/devel/lib/rtabmap_util/map_optimizer] Error 1 make[1]: *** [CMakeFiles/Makefile2:9561: rtabmap_ros/rtabmap_util/CMakeFiles/rtabmap_map_optimizer.dir/all] Error 2 make: *** [Makefile:146: all] Error 2 Invoking "make -j4" failed

How should I fix it?

chukhoi61 avatar Jan 12 '24 02:01 chukhoi61

What is the g2o version used on the computer? Ideally make sure only one is installed. Same thing for octomap library.

Try redoing a fresh make/install of rtabmap library (delete everything in build directory and redo cmake), then try again catkin_make.

matlabbe avatar Jan 13 '24 00:01 matlabbe