cannot load shared object file undefined symbol
cannot load shared object file undefined symbol
场景:
共享库里引用了主程序一个符号,结构编译的时候没问题,运行时用 dlopen 打开共享库报上述错误
原因:共享库使用的这个符号在主程序里没有任何调用,所以编译主程序时改符号没有被导出。需要在编译主程序时添加编译选项 : -export-dynamic
-export-dynamic:默认情况下,链接器在产生可执行文件时,为了减少符号表大只会将那些被其他模块引用到的符号放到动态符号表。也就是说,在共享模块引用主模块时,只有那些在链接时被共享模块引用到的符号才会被导出。当程序使用dlopen()加载某个共享模块时,如果该共享模块反向引用了主模块的符号,而该符号可能在链接时因为未被其他模块引用而未被导出到动态符号表,这样反向引用就会失败。这个参数就是用来解决这个问题的。它表示,链接器在产生可执行文件时,将所有全局符号导出动态符号表。
参考:http://duanple.blog.163.com/blog/static/7097176720111141085197/
cannot load shared object file undefined symbol的更多相关文章
- Iptables 报错Couldn't load target `ACCET':/lib64/xtables/libipt_ACCET.so: cannot open shared object file
[root@xxxx ~]# /etc/init.d/iptables restart iptables: Setting chains to policy ACCEPT: filter nat [ ...
- iptables报错:Couldn't load target `accept':/lib64/iptables/libipt_accept.so: cannot open shared object file: No such file or directory
语句:iptables -A INPUT -s 134.192.204.235 -p TCP --dport 11211 -j accept 报错:Couldn't load target `acce ...
- 关于ImportError: libssl.so.10: cannot open shared object file: No such file or directory unable to load app 0 (mountpoint='') (callable not found or import error)
一.问题描述 在亚马逊云服务器使用Nginx+uwsgi部署django项目时,项目可以使用python manage.py runserver正常运行,uwsgi测试也没问题,Nginx也正常启动, ...
- EBS安装提示libXtst.so.6: cannot open shared object file
$ ./rapidwiz Rapid Install Wizard is validating your file system...... CMDDIR=/app/Stage122/startCD/ ...
- libGraphicsMagickWand.so: cannot open shared object file: No such file or directory stack traceback:
参考博文:http://www.linuxidc.com/Linux/2016-07/133213.htm ==>> Check Passed, the num of bbox and f ...
- 错误:error libGL.so: cannot open shared object file: No such file or directory
Failed to load libGL.soerror libGL.so: cannot open shared object file: No such file or directory 启动e ...
- ImportError: libcudnn.so.5: cannot open shared object file: No such file or directory
ubuntu16.04安装cuda8.0,tensorflow-gpu版本后,运行时报错: ImportError: libcudnn.so.5: cannot open shared object ...
- cannot open shared object file: No such file or directory解决
cannot open shared object file: No such file or directory解决 ./move_db: error while loading shared ...
- Error While Loading Shared Libraries, Cannot Open Shared Object File
In the "I wish the Internet had an actual correct answer" category comes a question from a ...
随机推荐
- 代理缓存服务之Squid
代理缓存服务 Squid是linux系统中最为流行的一款高性能代理服务软件,通常用作Web网站的前置缓存服务,能够代替用户向网站服务器请求页面数据并进行缓存. 简单来说,Squid服务程序会按照收到的 ...
- WPF制作的小时钟
原文:WPF制作的小时钟 周末无事, 看到WEB QQ上的小时钟挺可爱的, 于是寻思着用WPF模仿着做一个. 先看下WEB QQ的图: 打开VS, 开始动工. 建立好项目后, 面对一个空荡荡的页面, ...
- Java线程---简介
实现方式 在java中线程有两种实现方式: 1.继承thread类 2.实现runnable接口 Thread类 Thread类时在java.lang包中定义的,继承thread类必须重写run()方 ...
- toolbar menu 字体颜色和大小
Toolbar菜单中menu当中我们大多数都使用图片来按钮,可是有些时候我们也会直接使用文字,文字的颜色如何修改呢. 其实很简单,我们只要修改styles.xml文件中,添加一句 <item n ...
- CC3200模块的内存地址划分和bootloader,启动流程(二)
1. 首先启动内部ROM固化的BOOT,然后这个ROM启动需要使用内存空间0X2000 0000 --- 0X2000 4000共16K的空间.一级BOOT的作用是串口升级和驱动库. 2. 然后是二级 ...
- gulp相关
'use strict'; var gulp = require('gulp'), webserver = require('gulp-webserver'), //gulp服务器 connect = ...
- “管中窥豹”,MyCAT的基因缺陷
提起MyCAT,我的脑海里,总是浮现出这样一首偈.弘忍觉得自己老了,需要找一个接班人,于是,弘忍要求弟子们每人写一个偈子,根据偈子观察各位弟子的开悟程度,从而传授正宗禅宗的衣钵.弟子们心里其实都很明白 ...
- 《Cracking the Coding Interview》——第17章:普通题——题目6
2014-04-28 22:49 题目:给定一个整数数组.如果你将其中一个子数组排序,那么整个数组都变得有序.找出所有这样子数组里最短的一个. 解法:线性时间,常数空间内可以解决,思想类似于动态规划. ...
- 《Cracking the Coding Interview》——第9章:递归和动态规划——题目10
2014-03-20 04:15 题目:你有n个盒子,用这n个盒子堆成一个塔,要求下面的盒子必须在长宽高上都严格大于上面的.如果你不能旋转盒子变换长宽高,这座塔最高能堆多高? 解法:首先将n个盒子按照 ...
- GridView与ListView冲突
由于GridView与listView都是继承自ScrollView,所以两个控件放在一起时需要重写控件方法 public class MyGridView extends GridView{ ...