Closed A-ASTON closed 7 months ago
单独拎一个出来看就是ld无法找到so库中的函数? /usr/bin/ld: /home/aston/projects/dpSLAM/SG-SLAM/src/sg-slam/lib/libsg-slam.so: undefined reference to ORB_SLAM2::Sim3Solver::GetEstimatedTranslation()'
使用ldd命令查看一下libsg-slam.so依赖的库是否有not found?
没有发现not found的库
无法理解出现该错误的原因。 或许你可以清空build、devel文件夹缓存后再次编译。
错误如下,请问如何解决?感谢 [ 94%] Linking CXX executable /home/aston/projects/dpSLAM/SG-SLAM/src/sg-slam/Examples/sg_slam_tum [ 94%] Linking CXX executable /home/aston/projects/dpSLAM/SG-SLAM/src/sg-slam/Examples/sg_slam_ros_rgbd /usr/bin/ld: /home/aston/projects/dpSLAM/SG-SLAM/src/sg-slam/lib/libsg-slam.so: undefined reference to
ORB_SLAM2::Sim3Solver::GetEstimatedTranslation()' /usr/bin/ld: /home/aston/projects/dpSLAM/SG-SLAM/src/sg-slam/lib/libsg-slam.so: undefined reference to
ORB_SLAM2::Sim3Solver::SetRansacParameters(double, int, int)' /usr/bin/ld: /home/aston/projects/dpSLAM/SG-SLAM/src/sg-slam/lib/libsg-slam.so: undefined reference toORB_SLAM2::Sim3Solver::GetEstimatedRotation()' /usr/bin/ld: /home/aston/projects/dpSLAM/SG-SLAM/src/sg-slam/lib/libsg-slam.so: undefined reference to
ORB_SLAM2::Sim3Solver::GetEstimatedScale()' /usr/bin/ld: /home/aston/projects/dpSLAM/SG-SLAM/src/sg-slam/lib/libsg-slam.so: undefined reference toORB_SLAM2::Sim3Solver::iterate(int, bool&, std::vector<bool, std::allocator<bool> >&, int&)' /usr/bin/ld: /home/aston/projects/dpSLAM/SG-SLAM/src/sg-slam/lib/libsg-slam.so: undefined reference to
ORB_SLAM2::Sim3Solver::Sim3Solver(ORB_SLAM2::KeyFrame, ORB_SLAM2::KeyFrame, std::vector<ORB_SLAM2::MapPoint, std::allocator<ORB_SLAM2::MapPoint> > const&, bool)' collect2: error: ld returned 1 exit status make[2]: [sg-slam/CMakeFiles/sg_slam_tum.dir/build.make:267: /home/aston/projects/dpSLAM/SG-SLAM/src/sg-slam/Examples/sg_slam_tum] Error 1 make[1]: [CMakeFiles/Makefile2:4415: sg-slam/CMakeFiles/sg_slam_tum.dir/all] Error 2 make[1]: Waiting for unfinished jobs.... /usr/bin/ld: /home/aston/projects/dpSLAM/SG-SLAM/src/sg-slam/lib/libsg-slam.so: undefined reference toORB_SLAM2::Sim3Solver::GetEstimatedTranslation()' /usr/bin/ld: /home/aston/projects/dpSLAM/SG-SLAM/src/sg-slam/lib/libsg-slam.so: undefined reference to
ORB_SLAM2::Sim3Solver::SetRansacParameters(double, int, int)' /usr/bin/ld: /home/aston/projects/dpSLAM/SG-SLAM/src/sg-slam/lib/libsg-slam.so: undefined reference toORB_SLAM2::Sim3Solver::GetEstimatedRotation()' /usr/bin/ld: /home/aston/projects/dpSLAM/SG-SLAM/src/sg-slam/lib/libsg-slam.so: undefined reference to
ORB_SLAM2::Sim3Solver::GetEstimatedScale()' /usr/bin/ld: /home/aston/projects/dpSLAM/SG-SLAM/src/sg-slam/lib/libsg-slam.so: undefined reference toORB_SLAM2::Sim3Solver::iterate(int, bool&, std::vector<bool, std::allocator<bool> >&, int&)' /usr/bin/ld: /home/aston/projects/dpSLAM/SG-SLAM/src/sg-slam/lib/libsg-slam.so: undefined reference to
ORB_SLAM2::Sim3Solver::Sim3Solver(ORB_SLAM2::KeyFrame, ORB_SLAM2::KeyFrame, std::vector<ORB_SLAM2::MapPoint, std::allocator<ORB_SLAM2::MapPoint> > const&, bool)' collect2: error: ld returned 1 exit status make[2]: [sg-slam/CMakeFiles/sg_slam_ros_rgbd.dir/build.make:267: /home/aston/projects/dpSLAM/SG-SLAM/src/sg-slam/Examples/sg_slam_ros_rgbd] Error 1 make[1]: [CMakeFiles/Makefile2:4386: sg-slam/CMakeFiles/sg_slam_ros_rgbd.dir/all] Error 2 make: [Makefile:141: all] Error 2 Invoking "make -j12 -l12" failed