最近在学习SLAM ch7实践部分时遇到如下问题,进行记录,希望对大家有所帮助
/usr/local/include/g2o/core/base_fixed_sized_edge.h:199:32:
error: ‘index_sequence’ is not a member of ‘std’
解决方案:在CMakeList.txt中将set(CMAKE_CXX_FLAGS "-std=c++11 -O2 ${SSE_FLAGS} -msse4")替换如下
set(CMAKE_CXX_STANDARD 14)
/home/feynman/slambook2-master/ch7/pose_estimation_3d2d.cpp:54:31:
error: ‘CV_LOAD_IMAGE_COLOR’ was not declared in this scope
解决方案:在源码C++文件中添加添加头文件
#include
/usr/local/include/fmt/core.h:1757:7:
error: static assertion failed: Cannot format an argument.
To make type T formattable provide a formatter specialization:
https://fmt.dev/latest/api.html#udt
解决方案:对CMakeList.txt文件中的target_link_libraries作出修改,添加Sophus::Sophus
target_link_libraries(xxxxxxx ${xxxxxxxx} Sophus::Sophus)
/home/feynman/slambook2-master/ch7/pose_estimation_2d2d.cpp:144:61:
error: ‘CV_FM_8POINT’ was not declared in this scope
解决方案:根据提示将pose_estimation_2d2d.cpp第144行代码修改为
fundamental_matrix = findFundamentalMat(points1, points2, FM_8POINT);
/usr/lib/gcc/x86_64-linux-gnu/9/include/popcntintrin.h:35:1:
error: inlining failed in call to always_inline ‘int _mm_popcnt_u32(unsigned int)’:
target specific option mismatch
解决方案:在CMakeList.txt中 set(CMAKE_CXX_……) 内容替换如下
set(CMAKE_CXX_FLAGS "-std=c++14 -mfma")