1、问题
wn@wn-virtual-machine:~/slambook2/ch4/example/build$ make
Scanning dependencies of target trajectoryError
[ 50%] Building CXX object CMakeFiles/trajectoryError.dir/trajectoryError.o
/home/wn/slambook2/ch4/example/trajectoryError.cpp:5:10: **fatal error**: sophus/se3.hpp: **No such file or directory**
#include **<sophus/se3.hpp>**
^~~~~~~~~~~~~~~~
compilation terminated.
CMakeFiles/trajectoryError.dir/build.make:62: recipe for target 'CMakeFiles/trajectoryError.dir/trajectoryError.o' failed
make[2]: *** [CMakeFiles/trajectoryError.dir/trajectoryError.o] Error 1
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/trajectoryError.dir/all' failed
make[1]: *** [CMakeFiles/trajectoryError.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2
2、解决
与书上做对比:
在CmakeLists.txt中添加
include_directories( "/home/wn/slambook2/3rdparty/Sophus")
include_directories("/usr/include/eigen3")
target_link_libraries( "/home/wn/Sophus/build/libSophus.so")
3、此类问题的关键就在于找到动态库地址
4、轨迹误差部分出现有关Pangolin.so的问题也是同样解决方法
./trajectoryError: error while loading shared libraries: libpangolin.so: cannot open shared object file: No such file or directory
解决方法:
target_link_libraries( "/home/wn/Pangolin/build/src/libPangolin.so")