栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 系统运维 > 运维 > Linux

【解决】ceres问题 error adding symbols: DSO missing from command line

Linux 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

【解决】ceres问题 error adding symbols: DSO missing from command line

问题描述
我在qt下使用ceres库下的example 2d图优化PS:已完成ceres库的安装
qt编译如下文件
报错如下

/usr/bin/ld: pose_graph_2d.o: undefined reference to symbol ‘ZN6google14FlagRegistererC1EPKcS2_S2_S2_PvS3
Makefile:255: recipe for target ‘TestCeres’ failed
//usr/lib/x86_64-linux-gnu/libgflags.so.2: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status

解决方法
1下载gflags库
git clone https://github.com/gflags/gflags.git
安装gflags
1 cd gflags
2 sudo mkdir build
3 sudo cmake …
4 sudo make
5 sudo make install
执行完可以看到以下输出
生成libgflags.a和libgflags_nothreads.a两个静态库
注意头文件导入目录/usr/local/include
2链接库
此时我们只需要在我们的工程里链接这两个静态库就可以了
我ubuntu下用的是qt,添加方式如下截图
最后编译正常

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/289779.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号