ubutnu vins_fisheye编译错误 hidden symbol“ “ in“ “ is referenced by DSO

/usr/bin/ld: /home/mwy/vins_fisheye/devel/lib/vins/vins_node: hidden symbol `_ZN5ceres12CostFunctionD2Ev' in /usr/local/lib/libceres.a(cost_function.cc.o) is referenced by DSO
/usr/bin/ld: 最后的链结失败: 错误的值
collect2: error: ld returned 1 exit status
VINS-Fisheye/vins_estimator/CMakeFiles/vins_node.dir/build.make:213: recipe for target '/home/mwy/vins_fisheye/devel/lib/vins/vins_node' failed
make[2]: *** [/home/mwy/vins_fisheye/devel/lib/vins/vins_node] Error 1
CMakeFiles/Makefile2:2651: recipe for target 'VINS-Fisheye/vins_estimator/CMakeFiles/vins_node.dir/all' failed
make[1]: *** [VINS-Fisheye/vins_estimator/CMakeFiles/vins_node.dir/all] Error 2
make[1]: *** 正在等待未完成的任务....
/usr/bin/ld: /home/mwy/vins_fisheye/devel/lib/vins/vins_node_fisheye: hidden symbol `_ZN5ceres12CostFunctionD2Ev' in /usr/local/lib/libceres.a(cost_function.cc.o) is referenced by DSO
/usr/bin/ld: 最后的链结失败: 错误的值
collect2: error: ld returned 1 exit status
VINS-Fisheye/vins_estimator/CMakeFiles/vins_node_fisheye.dir/build.make:214: recipe for target '/home/mwy/vins_fisheye/devel/lib/vins/vins_node_fisheye' failed
make[2]: *** [/home/mwy/vins_fisheye/devel/lib/vins/vins_node_fisheye] Error 1
CMakeFiles/Makefile2:3747: recipe for target 'VINS-Fisheye/vins_estimator/CMakeFiles/vins_node_fisheye.dir/all' failed
make[1]: *** [VINS-Fisheye/vins_estimator/CMakeFiles/vins_node_fisheye.dir/all] Error 2
Makefile:140: recipe for target 'all' failed
make: *** [all] Error 2

解决过程:

c++ - What does exactly the warning mean about hidden symbol being referenced by DSO? - Stack Overflow

 找到报错的位置 输入以下命令

 确实被隐藏了  也就是那个.hidden

 然后我去找到了用于构建ceres库的源码,从官方的CMakeLists里搜索hidden

找到了这几行

set(CMAKE_C_VISIBILITY_PRESET default)
set(CMAKE_CXX_VISIBILITY_PRESET default)
set(CMAKE_VISIBILITY_INLINES_HIDDEN OFF)

他们原来分别是hidden hidden 和ON 改成上面那样 重新编译安装ceres库就可以了 

 上面设置函数的默认导出可见性,用于设置动态链接库中函数的可见性,将变量或函数设置为hidden,则该符号仅在本so中可见,在其他库中则不可见。

动态链接库与静态链接库的区别_breakpoints_的博客-CSDN博客_动态链接库和静态链接库的区别 

  • 3
    点赞
  • 10
    收藏
    觉得还不错? 一键收藏
  • 6
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 6
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值