错误指示如下:

CMakeFiles/run_vo.dir/run_vo.cpp.o: In function `main':
run_vo.cpp:(.text.startup+0x1086): undefined reference to `Sophus::SE3::inverse() const'
run_vo.cpp:(.text.startup+0x10c9): undefined reference to `Sophus::SO3::matrix() const'
run_vo.cpp:(.text.startup+0x10ec): undefined reference to `Sophus::SO3::matrix() const'
run_vo.cpp:(.text.startup+0x110f): undefined reference to `Sophus::SO3::matrix() const'
run_vo.cpp:(.text.startup+0x1132): undefined reference to `Sophus::SO3::matrix() const'
run_vo.cpp:(.text.startup+0x1155): undefined reference to `Sophus::SO3::matrix() const'
CMakeFiles/run_vo.dir/run_vo.cpp.o:run_vo.cpp:(.text.startup+0x1178): more undefined references to `Sophus::SO3::matrix() const' follow
../../lib/libmyslam.so: undefined reference to `Sophus::SE3::SE3(Sophus::SO3 const&, Eigen::Matrix<double, , , , , > const&)'
../../lib/libmyslam.so: undefined reference to `Sophus::SE3::operator=(Sophus::SE3 const&)'
../../lib/libmyslam.so: undefined reference to `Sophus::SE3::SE3()'
../../lib/libmyslam.so: undefined reference to `Sophus::SE3::SE3(Sophus::SE3 const&)'
../../lib/libmyslam.so: undefined reference to `Sophus::SO3::SO3(double, double, double)'
../../lib/libmyslam.so: undefined reference to `Sophus::SE3::log() const'
../../lib/libmyslam.so: undefined reference to `Sophus::SE3::operator*(Sophus::SE3 const&) const'
../../lib/libmyslam.so: undefined reference to `Sophus::SE3::operator*(Eigen::Matrix<double, , , , , > const&) const'
collect2: error: ld returned exit status
test/CMakeFiles/run_vo.dir/build.make:: recipe for target '../bin/run_vo' failed
make[]: *** [../bin/run_vo] Error
CMakeFiles/Makefile2:: recipe for target 'test/CMakeFiles/run_vo.dir/all' failed
make[]: *** [test/CMakeFiles/run_vo.dir/all] Error
Makefile:: recipe for target 'all' failed
make: *** [all] Error

CMakeLists.txt中的Sophus

# Sophus
find_package( Sophus REQUIRED )
include_directories( ${Sophus_INCLUDE_DIRS} )

原因分析:
安装Sophus时,有个lib文件“libSophus.so”会出现在/usr/local/lib/libSophus.so 时,libSophus.so 应该被链接到 Sophus_LIBRARIES, cmake没链接上。

应该更改为

# Sophus
find_package( Sophus REQUIRED )
set(Sophus_LIBRARIES libSophus.so)
include_directories( ${Sophus_INCLUDE_DIRS} )

即显示链接Sophus_LIBRARIES 链接到libSophus.so

# Sophus
find_package( Sophus REQUIRED )
set(Sophus_LIBRARIES libSophus.so)
include_directories( ${Sophus_INCLUDE_DIRS} )

Sophus链接错误的更多相关文章

  1. vs2010静态链接MFC库报链接错误

    由于需要将MFC程序在其它电脑上运行,所以需要将动态链接的MFC改成静态链接,本以为很简单,没想到链接的时候出现下面的链接错误: uafxcw.lib(afxmem.obj) : error LNK2 ...

  2. 模板函数(template function)出现编译链接错误(link error)之解析

    总的结论:    将template function 或者 template class的完整定义直接放在.h文件中,然后加到要使用这些template function的.cpp文件中. 1. 现 ...

  3. Xerces链接错误原因之/Zc:wchar_t-设置不一致

    今天程序需要使用Xerces作为xml文件的解析与序列化工具,使用的是Xerces2.7.0版本.具体编译教程如下: 成功编译出了Xerces.dll和Xerces.lib.但是在链接到主工程的时候, ...

  4. Ogre1.6.5 编译链接错误之FreeImage

    这两天想重新学习下ogre,但是在vs2010上编译1.6.5的版本上遇到链接失败的问题,耗了不少时间这里记一下. 主要是一些重定义报错. >msvcprtd.lib(MSVCP100D.dll ...

  5. C++常见gcc编译链接错误解决方法

    除非明确说明,本文内容仅针对x86/x86_64的Linux开发环境,有朋友说baidu不到,开个贴记录一下(加粗字体是关键词): 用“-Wl,-Bstatic”指定链接静态库,使用“-Wl,-Bdy ...

  6. 关于ios 程序加载百度地图lib,出现链接错误:找不到符号 (null): _OBJC_CLASS_$_BMKMapManager的解决办法

    报告的错误信息 ld: warning: ignoring file /Users/5012/Documents/sphuang/IOS_project/baidu_map/ShareLocation ...

  7. Undefined symbols for architecture i386: "_crc32", referenced from:——crc链接错误

    有时候用别人的框架,你会碰到下面的错误,很是吓人,什么玩意,我怎么看不懂!!! Undefined symbols for architecture i386:  "_RELEASE&quo ...

  8. vs链接错误解决方法

    常见引起链接错误的主要原因是由于项目不能找到所需的动态库的路径: 这里介绍一下引用第三方动态库的配置方法: 方法一: vs加载动态库需要先把动态库拷贝到exe所在文件夹,再修改项目属性: 链接器-&g ...

  9. ueditor 正在读取目录及网络链接错误

    环境 ueditor1_3_5-gbk-net .NET版本3.5 如果把项目直接改成4.0不会出现这样的问题,查看 问题1:正在读取目录 找到ueditor/ueditor.config.js  找 ...

随机推荐

  1. spring boot 中统一异常处理

    基于 spring boot 对异常处理的不友好,现在通过其他的方式来统一处理异常 步骤一:自定义异常类 public class UserNotExistException extends Runt ...

  2. AS不能真机调试 (转)

    经常遇到这种问题 现总结一下原因 打开手机的开发人员选项,允许USB调试 AS--->tools--->android-->Enable ADB Interation选项 勾上. A ...

  3. jQuery插件开发的两种方法及$.fn.extend的详解(转)

    jQuery插件开发的两种方法及$.fn.extend的详解 jQuery插件开发分为两种:1 类级别.2 对象级别,下面为大家详细介绍下   jQuery插件开发分为两种: 1 类级别 类级别你可以 ...

  4. 模拟银行业务的JS实现

    /*开户.存款.挂失.补卡.取款.转账.余额查询.密码修改.交易查询.锁定账号.解锁账号等*//*C#第7天 请参考by-Qy*/ using System;using System.Collecti ...

  5. Dede文章标题长度修改

    方法一.首先你要进入dedecms后台,系统——系统基本参数——其他选项——文档标题最大长度——在这修改为200或更大(其实200应该是足够了). 方法二.进入phpmyadmin,点击dede_ar ...

  6. 快速了解和使用Photon Server

    https://blog.csdn.net/qq_36565626/article/details/78710787

  7. AD操作

    加泪滴 批量添加覆铜过孔(先铺铜以后,再批量添加过孔) 开槽   在KEPP—OUT层 部分区域 不敷铜 开窗  

  8. nodejs项目进程管理器之pm2

    如果用pm2作为nodejs的进程管理器的话,参考以下两篇文章 程序员小卡:http://www.cnblogs.com/chyingp/p/pm2-documentation.html 官方:htt ...

  9. 安装sql server 2008 提示错误 SQL Server 2005 Express 工具。 失败

    安装sql server 2008 management,提示错误:Sql2005SsmsExpressFacet 检查是否安装了 SQL Server 2005 Express 工具. 失败,已安装 ...

  10. C#的格式化(进制转换|位运算)

    1.首先做一下知识的普及C或c Currency 货币格式D或d Decimal 十进制格式E或e Exponent 指数格式F或f Fixed point (float)固定精度格式G或g Gene ...