Sophus libSophus.so
在编译包含Sophus的源文件的时候,出现如下错误
../lib/libmyslam.so: undefined reference to `Sophus::SO3::SO3(double, double, double)'
../lib/libmyslam.so: undefined reference to `Sophus::SE3::operator*(Eigen::Matrix<double, , , , , > const&) const'
../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&) const'
../lib/libmyslam.so: undefined reference to `Sophus::SE3::log() const'
../lib/libmyslam.so: undefined reference to `Sophus::SE3::operator=(Sophus::SE3 const&)'
../lib/libmyslam.so: undefined reference to `Sophus::SE3::inverse() const'
../lib/libmyslam.so: undefined reference to `Sophus::SE3::SE3()'
../lib/libmyslam.so: undefined reference to `Sophus::SE3::SE3(Sophus::SE3 const&)'
collect2: error: ld returned exit status
原因分析:
安装Sophus时,有个lib文件“libSophus.so”会出现在/usr/local/lib/libSophus.so
(本人编译时最后执行了 sudo make install, 因此在系统文件夹里面有该lib文件)。
当执行FIND_PACKAGE(sophus REQUIRED)时,libSophus.so 应该被链接到 Sophus_LIBRARIES,
但cmake却没链接上。
决办法:
显式将Sophus_LIBRARIES 链接到libSophus.so,CMakeLists.txt的代码如下:
cmake_minimum_required( VERSION 2.8 )
project( useSophus ) # 为使用 sophus,您需要使用find_package命令找到它
find_package( sophus REQUIRED )
set(Sophus_LIBRARIES "/home/guorun/vision_slam/slambook/3rdparty/Sophus/libSophus.so")
include_directories("/usr/include/eigen3")
include_directories( ${Sophus_INCLUDE_DIRS} ) add_executable( useSophus useSophus.cpp )
target_link_libraries( useSophus ${Sophus_LIBRARIES} )
即可成功。
以上使用的是老版本的Sophus,新版本的还未测试!!!
Sophus libSophus.so的更多相关文章
- cmake find_package 中,include_directories,target_link_libraries 的值怎么知道?
拿Sophus库为例: find_package(Sophus REQUIRED) include_directories(${Sophus_INCLUDE_DIRS}) target_link_li ...
- Sophus链接错误
错误指示如下: CMakeFiles/run_vo.dir/run_vo.cpp.o: In function `main': run_vo.cpp:(.text.startup+0x1086): u ...
- Sophus库CMakeLists.txt内容详解笔记
CMakeLists.txt: SET(PROJECT_NAME Sophus) PROJECT(${PROJECT_NAME}) CMAKE_MINIMUM_REQUIRED(VERSION 2.6 ...
- Could not find a package configuration file provided by "Sophus",SophusConfig.cmake
CMake Error at CMakeLists.txt:5 (find_package): By not providing "FindSophus.cmake" in CMA ...
- ubuntu16.04下安装Sophus
git clone https://github.com/strasdat/Sophus.git 下载完成后 cd Sophus git checkout a621ffmkdir buildcd bu ...
- Sophus VS2010编译不支持?C++11语法的缘故。那有没有不带C++11特性的Sophus版本呢?
Eigen:3.1 3.0 Ceres:No Sophus: Sophus支不支持Windows编译?官网写的是通过了Windows的编译的 linux, os x: windows: code ...
- 使用Sophus练习李群SO3、SE3以及对应的李代数so3、se3
这是高博<视觉SLAM14讲,从理论到实践>第4章的练习.加了一些注释和理解: #include <iostream>#include <cmath>using n ...
- SLAM十四讲中Sophus库安装
Sophus截止目前有很多版本,其中大体分为两类,一种是用模板实现的方法,一种是用非模板类实现的,SLAM十四讲中使用的是非模板类库,clone Sophus: git clone http://gi ...
- 如何安装Eigen库和Sophus库
* { font-family: "Tibetan Machine Uni", "sans-serif", STFangSong; outline: none ...
随机推荐
- Jmeter:性能测试指南(转)
http://yukinami.github.io/2015/11/26/%E6%80%A7%E8%83%BD%E6%B5%8B%E8%AF%95%E6%8C%87%E5%8D%97/ 性能测试指南 ...
- GreenDao在列中的单词之间自动加_
1.第一种情况,原字段(属性.列)是 驼峰式命名法 @Entitypublic class Employee { @Id(autoincrement = true) private Long id; ...
- jquery使用FormData提交数据
在jquery中,使用ajax提交表单数据. FormData可以很方便地获取到表单中的所有数据. 注意: ajax中的data参数为FormData类型时,contentType就不要设置成appl ...
- 11. Container With Most Water(头尾双指针)
Given n non-negative integers a1, a2, ..., an, where each represents a point at coordinate (i, ai). ...
- OpenGL ES 2 for Android - A Quick Start Guide
英文原版,语法很简单,带书签,带实例,很好的书,从头到尾讲述OpenGL强烈推荐!~~~ 扫码时备注或说明中留下邮箱 付款后如未回复请至https://shop135452397.taobao.com ...
- vue router返回上一页
this.$router.go(-1) 不用router时,使用window.history.go(-1);
- C#判断文件和文件夹是否存在 不存在则创建
using System.IO;string path = @"D:\accountDaoRu\"; if (Directory.Exists(path) == fa ...
- [leetcode]151. Reverse Words in a String翻转给定字符串中的单词
Given an input string, reverse the string word by word. Example: Input: "the sky is blue", ...
- php7下安装event扩展
有效安排I/O,时间和信号的扩展 使用可用于特定平台的最佳I/O通知机制的事件,是PHP基础设施的libevent端口. 下载地址:http://pecl.php.net/package/event ...
- FOR ALL ENTRIES的使用
使用FOR ALL ENTRIES时注意: 1.一定要确定要有是否为空的判断 2.一定要注明两个表之间数据的关系 eg: IF GT_TJ30T[] IS NOT INITIAL. SELE ...