catkin_make error
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_traitsg2o::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
How should I fix it?
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.