ch4:
关于fmt的使用:‘fmt::v8::detail::assert_fail(char const*, int, char const*)’未定义的引用’
在cmakelists文件中添加
find_package(fmt REQUIRED)
set(FMT_LIBRARIES fmt::fmt)
ch5:
1.关于imageBasics:
CmakeLists文件添加:
find_package(OpenCV REQUIRED)
2.关于rgb:
cmakelists
①添加fmt:
target_link_libraries(joinMap ${OpenCV_LIBS} ${Pangolin_LIBRARIES} fmt)
注意:fmt前边要有空格
②添加包
find_package(OpenCV REQUIRED)
find_package(fmt REQUIRED)
set(FMT_LIBRARIES fmt::fmt)
add_executable(joinMap joinMap.cpp)
3.关于stereoVison:
CMakeLists文件添加:
find_package(OpenCV REQUIRED)
include_directories(${OpenCV_INCLUDE_DIRS})
用来寻找opencv包
ch7:
cmakelists
①添加C++14编译
把
set(CMAKE_CXX_FLAGS "-std=c++11 -O2 ${SSE_FLAGS} -msse4")
改成
set(CMAKE_CXX_FLAGS "-std=c++14 -mfma")
原因:视觉SLAM书上的程序使用的g2o版本比较旧了,使用的是c++11版本的g20。而自己在编译g2o的时候编译的是最新版本的g2o,里面大量使用了c++14标准库的一些新特性,比如std::index_sequence等等。而书上的CMakeLists.txt默认使用的是c++11进行cmake编译,所以报错。
②增加fmt链接:
把
add_executable(pose_estimation_3d2d pose_estimation_3d2d.cpp)
target_link_libraries(pose_estimation_3d2d
g2o_core g2o_stuff
${OpenCV_LIBS})
add_executable(pose_estimation_3d3d pose_estimation_3d3d.cpp)
target_link_libraries(pose_estimation_3d3d
g2o_core g2o_stuff
${OpenCV_LIBS})
改成
add_executable(pose_estimation_3d2d pose_estimation_3d2d.cpp)
target_link_libraries(pose_estimation_3d2d
g2o_core g2o_stuff
${OpenCV_LIBS} fmt)
add_executable(pose_estimation_3d3d pose_estimation_3d3d.cpp)
target_link_libraries(pose_estimation_3d3d
g2o_core g2o_stuff
${OpenCV_LIBS} fmt)
③orb_self.cpp文件的两个图片地址可以改一下