错误指示如下:

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. mybatis forEach使用

    1.集合的使用 <select id="getCitysByKeys" resultMap="city" parameterType="Arra ...

  2. awk技巧 nginx access.log

    1.1 介绍 awk其名称得自于它的创始人 Alfred Aho .Peter Weinberger 和 Brian Kernighan 姓氏的首个字母.实际上 AWK 的确拥有自己的语言: AWK ...

  3. l2-22(重排链表)

    题目链接:https://pintia.cn/problem-sets/994805046380707840/problems/994805057860517888 题意:给定链表L1->L2- ...

  4. JavaScript Validate a Valid Date formatted as "mm/dd/yyyy"

    // Validates that the input string is a valid date formatted as "mm/dd/yyyy" function isVa ...

  5. 成对使用new和delete,传值传引用

    首先: delete []p;是用来删除对象数组的,特别是你声明的是对象数组!!! 如果new中用了[],delete一定要用[]:在new中没有使用,在delete中一定不要使用. 其次: 当你使用 ...

  6. Python: packer方式加密js代码之解密函数

    起源: 解析一网站时,发现其视频信息为一段js代码动态生成,而此段js代码,是用packer加密的. 其加密后的代码段如下: eval(function(p,a,c,k,e,d){e=function ...

  7. 设a、b、c均是0到9之间的数字,abc、bcc是两个三位数,且有:abc+bcc=532。求满足条件的所有a、b、c的值。

    题目描述 设a.b.c均是0到9之间的数字,abc.bcc是两个三位数,且有:abc+bcc=532.求满足条件的所有a.b.c的值. 输入描述: 题目没有任何输入. 输出描述: 请输出所有满足题目条 ...

  8. awk参数解析

    # awk --help Usage: awk [POSIX or GNU style options] -f progfile [--] file ... Usage: awk [POSIX or ...

  9. setTimeout设置为0的意义

    今天再看 Promise 代码时,有个地方用到了setTimeOut函数,但是第2个参数设为0,顿时懵逼了,这是啥意思? function resolve(newValue) { value = ne ...

  10. 【C++】:STL迭代器使用---[容器::iterator iter;]

    参考文章:http://blog.csdn.net/qq_23100787/article/details/51388163 迭代器这种东西,就是为了使访问简单!! 容器::iterator iter ...