Sophus链接错误
错误指示如下:
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链接错误的更多相关文章
- vs2010静态链接MFC库报链接错误
由于需要将MFC程序在其它电脑上运行,所以需要将动态链接的MFC改成静态链接,本以为很简单,没想到链接的时候出现下面的链接错误: uafxcw.lib(afxmem.obj) : error LNK2 ...
- 模板函数(template function)出现编译链接错误(link error)之解析
总的结论: 将template function 或者 template class的完整定义直接放在.h文件中,然后加到要使用这些template function的.cpp文件中. 1. 现 ...
- Xerces链接错误原因之/Zc:wchar_t-设置不一致
今天程序需要使用Xerces作为xml文件的解析与序列化工具,使用的是Xerces2.7.0版本.具体编译教程如下: 成功编译出了Xerces.dll和Xerces.lib.但是在链接到主工程的时候, ...
- Ogre1.6.5 编译链接错误之FreeImage
这两天想重新学习下ogre,但是在vs2010上编译1.6.5的版本上遇到链接失败的问题,耗了不少时间这里记一下. 主要是一些重定义报错. >msvcprtd.lib(MSVCP100D.dll ...
- C++常见gcc编译链接错误解决方法
除非明确说明,本文内容仅针对x86/x86_64的Linux开发环境,有朋友说baidu不到,开个贴记录一下(加粗字体是关键词): 用“-Wl,-Bstatic”指定链接静态库,使用“-Wl,-Bdy ...
- 关于ios 程序加载百度地图lib,出现链接错误:找不到符号 (null): _OBJC_CLASS_$_BMKMapManager的解决办法
报告的错误信息 ld: warning: ignoring file /Users/5012/Documents/sphuang/IOS_project/baidu_map/ShareLocation ...
- Undefined symbols for architecture i386: "_crc32", referenced from:——crc链接错误
有时候用别人的框架,你会碰到下面的错误,很是吓人,什么玩意,我怎么看不懂!!! Undefined symbols for architecture i386: "_RELEASE&quo ...
- vs链接错误解决方法
常见引起链接错误的主要原因是由于项目不能找到所需的动态库的路径: 这里介绍一下引用第三方动态库的配置方法: 方法一: vs加载动态库需要先把动态库拷贝到exe所在文件夹,再修改项目属性: 链接器-&g ...
- ueditor 正在读取目录及网络链接错误
环境 ueditor1_3_5-gbk-net .NET版本3.5 如果把项目直接改成4.0不会出现这样的问题,查看 问题1:正在读取目录 找到ueditor/ueditor.config.js 找 ...
随机推荐
- Structured streaming
Structured streaming是spark 2.0以后新增的用于实时处理的技术.与spark streaming不同的是,Structured streaming打开了数据源到数据落地之间的 ...
- matomo 开源网站分析平台
1.安装PHP https://www.jianshu.com/p/8d54a401ec06 yum remove php* yum -y install epel-release rpm -Uvh ...
- pta7-19打印学生选课清单(模拟)
题目链接:https://pintia.cn/problem-sets/1101307589335527424/problems/1101314114875633664 题意:输入n个学生,k門课程, ...
- tf.trainable_variables()
https://blog.csdn.net/shwan_ma/article/details/78879620 一般来说,打印tensorflow变量的函数有两个:tf.trainable_varia ...
- 94. Binary Tree Inorder Traversal(Tree, stack)
Given a binary tree, return the inorder traversal of its nodes' values. For example:Given binary tre ...
- JMeter快速入门之Badboy录制
1. 前言 JMeter录制有两种方式,一种是JMeter自带录制方法,另一种是下面要学习的Badboy录制,个人推荐使用此方法 下面教程不设计Badboy安装,可以百度一下. 2. 录制步骤: 2. ...
- RxJS之Subject主题 ( Angular环境 )
一 Subject主题 Subject是Observable的子类.- Subject是多播的,允许将值多播给多个观察者.普通的 Observable 是单播的. 在 Subject 的内部,subs ...
- 项目总结02:百度地图js 基本用法介绍
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/ ...
- 浅析Java 数组-基础详解
什么是数组:数组对于每一门编程语言来说都是重要的数据结构之一,当然不同语言对数组的实现及处理也不尽相同. Java 数组:用来存储固定大小的同类型元素. 一 声明.创建,初始化Java 数组 写在前面 ...
- javaweb导出excel
百度找了半天也没找到一个提供有效思路的,全都告诉我此路不通 html表格数据粘贴到txt,然后改后缀为xsl,打开,发现二者无缝对接 @参考文章.@参考前任项目 /** * @todo * @para ...