视觉slam十四讲的一些问题记录

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文件的两个图片地址可以改一下

  • 0
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值