问题描述

在正常安装了Sophus库后,运行高博的代码,发现如下错误

####
#### Running command: "make -j16 -l16" in "/home/a/SLAM/slam_ws/build"
####
Scanning dependencies of target useSophus
[ 33%] Built target hello
[ 33%] Built target hello_shared
[ 33%] Built target plotTrajectory
[ 44%] Built target helloSLAM
[ 55%] Built target useGeometry
[ 72%] Built target cooridinateTransform
[ 77%] Built target eigenMatrix
[ 83%] Building CXX object ch4/CMakeFiles/useSophus.dir/src/useSophus.cpp.o
[ 94%] Built target useHello
[100%] Linking CXX executable /home/a/SLAM/slam_ws/devel/lib/ch4/useSophus
/usr/bin/ld: CMakeFiles/useSophus.dir/src/useSophus.cpp.o: in function `std::make_unsigned<long>::type fmt::v8::detail::to_unsigned<long>(long)':
/usr/local/include/fmt/core.h:426: undefined reference to `fmt::v8::detail::assert_fail(char const*, int, char const*)'
/usr/bin/ld: CMakeFiles/useSophus.dir/src/useSophus.cpp.o: in function `std::make_unsigned<int>::type fmt::v8::detail::to_unsigned<int>(int)':
/usr/local/include/fmt/core.h:426: undefined reference to `fmt::v8::detail::assert_fail(char const*, int, char const*)'
/usr/bin/ld: CMakeFiles/useSophus.dir/src/useSophus.cpp.o: in function `void fmt::v8::print<Eigen::Product<Eigen::Matrix<double, 3, 3, 0, 3, 3>, Eigen::Transpose<Eigen::Matrix<double, 3, 3, 0, 3, 3> const>, 0> const>(fmt::v8::basic_format_string<char, fmt::v8::type_identity<Eigen::Product<Eigen::Matrix<double, 3, 3, 0, 3, 3>, Eigen::Transpose<Eigen::Matrix<double, 3, 3, 0, 3, 3> const>, 0> const>::type>, Eigen::Product<Eigen::Matrix<double, 3, 3, 0, 3, 3>, Eigen::Transpose<Eigen::Matrix<double, 3, 3, 0, 3, 3> const>, 0> const&&)':
/usr/local/include/fmt/core.h:3208: undefined reference to `fmt::v8::vprint(fmt::v8::basic_string_view<char>, fmt::v8::basic_format_args<fmt::v8::basic_format_context<fmt::v8::appender, char> >)'
/usr/bin/ld: CMakeFiles/useSophus.dir/src/useSophus.cpp.o: in function `void fmt::v8::print<>(fmt::v8::basic_format_string<char>)':
/usr/local/include/fmt/core.h:3208: undefined reference to `fmt::v8::vprint(fmt::v8::basic_string_view<char>, fmt::v8::basic_format_args<fmt::v8::basic_format_context<fmt::v8::appender, char> >)'
/usr/bin/ld: CMakeFiles/useSophus.dir/src/useSophus.cpp.o: in function `void fmt::v8::print<double>(fmt::v8::basic_format_string<char, fmt::v8::type_identity<double>::type>, double&&)':
/usr/local/include/fmt/core.h:3208: undefined reference to `fmt::v8::vprint(fmt::v8::basic_string_view<char>, fmt::v8::basic_format_args<fmt::v8::basic_format_context<fmt::v8::appender, char> >)'
/usr/bin/ld: CMakeFiles/useSophus.dir/src/useSophus.cpp.o: in function `void fmt::v8::print<>(fmt::v8::basic_format_string<char>)':
/usr/local/include/fmt/core.h:3208: undefined reference to `fmt::v8::vprint(fmt::v8::basic_string_view<char>, fmt::v8::basic_format_args<fmt::v8::basic_format_context<fmt::v8::appender, char> >)'
/usr/bin/ld: CMakeFiles/useSophus.dir/src/useSophus.cpp.o: in function `fmt::v8::basic_format_parse_context<char, fmt::v8::detail::error_handler>::on_error(char const*)':
/usr/local/include/fmt/core.h:693: undefined reference to `fmt::v8::detail::error_handler::on_error(char const*)'
/usr/bin/ld: CMakeFiles/useSophus.dir/src/useSophus.cpp.o: in function `char const* fmt::v8::detail::parse_align<char, fmt::v8::detail::specs_checker<fmt::v8::detail::dynamic_specs_handler<fmt::v8::basic_format_parse_context<char, fmt::v8::detail::error_handler> > >&>(char const*, char const*, fmt::v8::detail::specs_checker<fmt::v8::detail::dynamic_specs_handler<fmt::v8::basic_format_parse_context<char, fmt::v8::detail::error_handler> > >&)':
/usr/local/include/fmt/core.h:2302: undefined reference to `fmt::v8::detail::assert_fail(char const*, int, char const*)'
/usr/bin/ld: CMakeFiles/useSophus.dir/src/useSophus.cpp.o: in function `int fmt::v8::detail::parse_nonnegative_int<char>(char const*&, char const*, int)':
/usr/local/include/fmt/core.h:2278: undefined reference to `fmt::v8::detail::assert_fail(char const*, int, char const*)'
/usr/bin/ld: CMakeFiles/useSophus.dir/src/useSophus.cpp.o: in function `char const* fmt::v8::detail::parse_width<char, fmt::v8::detail::specs_checker<fmt::v8::detail::dynamic_specs_handler<fmt::v8::basic_format_parse_context<char, fmt::v8::detail::error_handler> > >&>(char const*, char const*, fmt::v8::detail::specs_checker<fmt::v8::detail::dynamic_specs_handler<fmt::v8::basic_format_parse_context<char, fmt::v8::detail::error_handler> > >&)':
/usr/local/include/fmt/core.h:2399: undefined reference to `fmt::v8::detail::assert_fail(char const*, int, char const*)'
/usr/bin/ld: CMakeFiles/useSophus.dir/src/useSophus.cpp.o: in function `void fmt::v8::detail::check_string_type_spec<fmt::v8::detail::error_handler&>(fmt::v8::presentation_type, fmt::v8::detail::error_handler&)':
/usr/local/include/fmt/core.h:2805: undefined reference to `fmt::v8::detail::error_handler::on_error(char const*)'
/usr/bin/ld: CMakeFiles/useSophus.dir/src/useSophus.cpp.o: in function `void fmt::v8::detail::format_value<char, Eigen::Product<Eigen::Matrix<double, 3, 3, 0, 3, 3>, Eigen::Transpose<Eigen::Matrix<double, 3, 3, 0, 3, 3> const>, 0> >(fmt::v8::detail::buffer<char>&, Eigen::Product<Eigen::Matrix<double, 3, 3, 0, 3, 3>, Eigen::Transpose<Eigen::Matrix<double, 3, 3, 0, 3, 3> const>, 0> const&, fmt::v8::detail::locale_ref)':
/usr/local/include/fmt/ostream.h:75: undefined reference to `std::locale fmt::v8::detail::locale_ref::get<std::locale>() const'
/usr/bin/ld: CMakeFiles/useSophus.dir/src/useSophus.cpp.o: in function `fmt::v8::detail::fill_t<char>::operator=(fmt::v8::basic_string_view<char>)':
/usr/local/include/fmt/core.h:2041: undefined reference to `fmt::v8::detail::throw_format_error(char const*)'
/usr/bin/ld: CMakeFiles/useSophus.dir/src/useSophus.cpp.o: in function `char const* fmt::v8::detail::do_parse_arg_id<char, fmt::v8::detail::parse_width<char, fmt::v8::detail::specs_checker<fmt::v8::detail::dynamic_specs_handler<fmt::v8::basic_format_parse_context<char, fmt::v8::detail::error_handler> > >&>(char const*, char const*, fmt::v8::detail::specs_checker<fmt::v8::detail::dynamic_specs_handler<fmt::v8::basic_format_parse_context<char, fmt::v8::detail::error_handler> > >&)::width_adapter&>(char const*, char const*, fmt::v8::detail::specs_checker<fmt::v8::detail::dynamic_specs_handler<fmt::v8::basic_format_parse_context<char, fmt::v8::detail::error_handler> > >&)':
/usr/local/include/fmt/core.h:2346: undefined reference to `fmt::v8::detail::assert_fail(char const*, int, char const*)'
/usr/bin/ld: CMakeFiles/useSophus.dir/src/useSophus.cpp.o: in function `char const* fmt::v8::detail::do_parse_arg_id<char, fmt::v8::detail::parse_precision<char, fmt::v8::detail::specs_checker<fmt::v8::detail::dynamic_specs_handler<fmt::v8::basic_format_parse_context<char, fmt::v8::detail::error_handler> > >&>(char const*, char const*, fmt::v8::detail::specs_checker<fmt::v8::detail::dynamic_specs_handler<fmt::v8::basic_format_parse_context<char, fmt::v8::detail::error_handler> > >&)::precision_adapter&>(char const*, char const*, fmt::v8::detail::specs_checker<fmt::v8::detail::dynamic_specs_handler<fmt::v8::basic_format_parse_context<char, fmt::v8::detail::error_handler> > >&)':
/usr/local/include/fmt/core.h:2346: undefined reference to `fmt::v8::detail::assert_fail(char const*, int, char const*)'
/usr/bin/ld: CMakeFiles/useSophus.dir/src/useSophus.cpp.o: in function `int fmt::v8::detail::get_dynamic_spec<fmt::v8::detail::width_checker, fmt::v8::basic_format_arg<fmt::v8::basic_format_context<fmt::v8::appender, char> >, fmt::v8::detail::error_handler>(fmt::v8::basic_format_arg<fmt::v8::basic_format_context<fmt::v8::appender, char> >, fmt::v8::detail::error_handler)':
/usr/local/include/fmt/format.h:2287: undefined reference to `fmt::v8::detail::error_handler::on_error(char const*)'
/usr/bin/ld: CMakeFiles/useSophus.dir/src/useSophus.cpp.o: in function `int fmt::v8::detail::get_dynamic_spec<fmt::v8::detail::precision_checker, fmt::v8::basic_format_arg<fmt::v8::basic_format_context<fmt::v8::appender, char> >, fmt::v8::detail::error_handler>(fmt::v8::basic_format_arg<fmt::v8::basic_format_context<fmt::v8::appender, char> >, fmt::v8::detail::error_handler)':
/usr/local/include/fmt/format.h:2287: undefined reference to `fmt::v8::detail::error_handler::on_error(char const*)'
/usr/bin/ld: CMakeFiles/useSophus.dir/src/useSophus.cpp.o: in function `void fmt::v8::detail::check_string_type_spec<fmt::v8::detail::error_handler>(fmt::v8::presentation_type, fmt::v8::detail::error_handler&&)':
/usr/local/include/fmt/core.h:2805: undefined reference to `fmt::v8::detail::error_handler::on_error(char const*)'
/usr/bin/ld: CMakeFiles/useSophus.dir/src/useSophus.cpp.o: in function `unsigned long long fmt::v8::detail::width_checker<fmt::v8::detail::error_handler>::operator()<int, 0>(int)':
/usr/local/include/fmt/format.h:2249: undefined reference to `fmt::v8::detail::error_handler::on_error(char const*)'
/usr/bin/ld: CMakeFiles/useSophus.dir/src/useSophus.cpp.o: in function `unsigned long long fmt::v8::detail::width_checker<fmt::v8::detail::error_handler>::operator()<unsigned int, 0>(unsigned int)':
/usr/local/include/fmt/format.h:2249: undefined reference to `fmt::v8::detail::error_handler::on_error(char const*)'
/usr/bin/ld: CMakeFiles/useSophus.dir/src/useSophus.cpp.o:/usr/local/include/fmt/format.h:2249: more undefined references to `fmt::v8::detail::error_handler::on_error(char const*)' follow
collect2: error: ld returned 1 exit status
make[2]: *** [ch4/CMakeFiles/useSophus.dir/build.make:84:/home/a/SLAM/slam_ws/devel/lib/ch4/useSophus] 错误 1
make[1]: *** [CMakeFiles/Makefile2:878:ch4/CMakeFiles/useSophus.dir/all] 错误 2
make: *** [Makefile:141:all] 错误 2
Invoking "make -j16 -l16" failed

原因分析:

可能是因为没有进行连接吧,编译器没有找到Sophus库

解决方案:

只需要将CMakeList.txt文件改一下就好了

原文件

find_package(Sophus REQUIRED)
include_directories(${Sophus_INCLUDE_DIRS})
add_executable( useSophus useSophus.cpp)

更改后文件

include_directories("/usr/include/eigen3")
set(CMAKE_BUILD_TYPE "Debug")
find_package(Sophus REQUIRED)
include_directories(${Sophus_INCLUDE_DIRS})
add_executable( useSophus useSophus.cpp)
target_link_libraries(useSophus Sophus::Sophus)

[SLAM]高博视觉SLAM十四讲ch4中useSophus报错相关推荐

  1. java中过滤流_第十四讲 Java中的字节流和过滤流

    第十四讲Java中的字节流和过滤流 主要内容 InputStream和FileInputStream OutputStream和FileOutputStream 文件字节IO流应用举例 过滤流类和常用 ...

  2. 高博视觉SLAM十四讲思维导图分享

    最近学习高博士的视觉slam十四讲,学到后面忘了前面(害~学渣一枚罢了),并且到后期所有的知识都需要交叉使用.融会贯通,所有自己根据高博的课程做了个思维导图,分享链接就放在这里啦!希望可以帮助到大家. ...

  3. SLAM十四讲 ch4 Sophus库安装避雷和使用

    Eigen库 在ch3中已经装好了Eigen库,我是用的ubantu20,现在直接使用下属命令就已经装的是Eigen3.3.7版本了 sudo apt-get install libeigen3-de ...

  4. slam十四讲ch4

    文章目录 ch4-主要内容推导 + 课后习题 [十四讲] 主要目标 4.1 群 4.2 李群与李代数 4.3 指数映射和对数映射 4.4 李代数求导与扰动模型 实践:Sophus库的使用 2.课后习题 ...

  5. 视觉SALM十四讲学习笔记——第七讲 视觉里程计(1)

    视觉里程计这一部分的第一个主要内容是ORB特征点的提取与匹配.这里主要关注两个内容: (1)特征点的匹配方法及代码实现 (2)ORB特征点的BRIEF描述子如何实现旋转不变性及在示例代码中的体现 1. ...

  6. 高博视觉SLAM十四讲--罗德里格斯公式推导

    罗德里格斯的推导 1.所要证明的信息 1.翻到视觉SLAM14讲,要证明公式3.15 2.首先看图 已知v'=Rv,求旋转矩阵R和旋转向量(u,θ)之间的关系,其中u为单位向量,||u||=1,u即为 ...

  7. 视觉SLAM十四讲 报错ch13 问题汇总 /usr/bin/ld: /usr/local/lib/libfmt.a(format.cc.o)

    视觉SLAM十四讲 报错ch13 /usr/bin/ld: /usr/local/lib/libfmt.a 1. 问题1:未链接fmt库 1.1 解决方案 2. 问题2:-fPIC 2.1 解决方案 ...

  8. 《视觉slam十四讲》ch5相机与图像学习笔记(3)——实践部分 RGB-D相机代码解释及相关函数介绍

    在这篇博客中,主要介绍<视觉SLAM十四讲>第五讲的实践部分--RGB-D代码详解.关于imageBasics的代码可见我另一篇博客: <视觉slam十四讲>ch5学习笔记(1 ...

  9. 高博十四讲中第六章非线性优化 由于g2o更新出现的问题解决

    在高博视觉slam十四讲中的第6讲中实践g2o中出现了编译错误: /home/yk/桌面/slambook-master/ch6/g2o_curve_fitting/main.cpp: In func ...

最新文章

  1. python 使用 struct 把数据变成字节流
  2. 超实用 Linux下通过VNC安装Oracle
  3. django-vue-admin脚手架快速开发CRUD教程
  4. google套件_Google 推出 3 款语音识别应用,想用 AI 帮语言障碍者说话
  5. 分析以太网帧结构_传统以太网中的——中继器及集线器
  6. c++客户端发送加锁_MySQL语句加锁分析详解
  7. [Swift]LeetCode145. 二叉树的后序遍历 | Binary Tree Postorder Traversal
  8. Step by Step-构建自己的ORM系列-ORM改进方案思考(上)
  9. Memcache UDP 反射放大超大规模的DDoS攻击如何防御?
  10. 产品经理学习——Axure常用快捷键
  11. ubuntu freeswitch安装
  12. win10 jFrameDesigner安装
  13. 中国智慧园区标准化白皮书 附下载
  14. Duplicate Cleaner Pro(电脑重复文件清理软件)官方中文版V5.15.0 | 重复文件查找王下载
  15. 原生安卓开发!最详细的解释小白也能听懂,全网独家首发!
  16. 如何使用CK-S610-A01擦写RI-TRP-DR2B-40玻璃管标签的数据信息
  17. 用while实现一个简单的猜数字小游戏
  18. python是什么?工作前景如何?怎么算有基础?爬数据违法嘛?。。
  19. 计算机考证相关的证书
  20. js篇--学习web-api第一天(DOM的学习)

热门文章

  1. Centos6安装RabbitMQ
  2. 电源接反了烧电路怎么办?电源防反接技术讨论
  3. 网页不收录的5大原因及解决办法
  4. 安全运维和安全运营的区别
  5. potplayer默认专辑加载同一文件夹下所有视频,只读取一部分视频,加载视频目录不完整
  6. 工作展望简短_2018励志句子简短大全 展望2018励志正能量句子最新励志说说
  7. Typora使用方法简单总结
  8. Python气象绘图笔记——常用气象绘图函数脚本封装与使用记录
  9. 2020中南大学研究生招生夏令营机试题
  10. Excel+VBA+之快速上手(2)