视觉SLAM十四讲 fatal error: boost/format.hpp: No such file or directory
在编译高博的视觉SLAM十四讲第5讲的imageBasics.cpp
时,出现编译错误:
[ 87%] Building CXX object rgbd/CMakeFiles/joinMap.dir/joinMap.cpp.o
/home/liuyingfeng/workspace/slam/slambook2/ch5/rgbd/joinMap.cpp:4:10: fatal error: boost/format.hpp: No such file or directory
#include <boost/format.hpp> // for formating strings
^~~~~~~~~~~~~~~~~~
compilation terminated.
rgbd/CMakeFiles/joinMap.dir/build.make:62: recipe for target 'rgbd/CMakeFiles/joinMap.dir/joinMap.cpp.o' failed
make[2]: *** [rgbd/CMakeFiles/joinMap.dir/joinMap.cpp.o] Error 1
CMakeFiles/Makefile2:234: recipe for target 'rgbd/CMakeFiles/joinMap.dir/all' failed
make[1]: *** [rgbd/CMakeFiles/joinMap.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2
解决方法,安装libboost-all-dev
:
sudo apt-get install libboost-all-dev
简单粗暴。