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 ...
随机推荐
- B1005 继续(3n+1)猜想 (25分)
B1005 继续(3n+1)猜想 (25分) 卡拉兹(Callatz)猜想已经在1001中给出了描述.在这个题目里,情况稍微有些复杂. 当我们验证卡拉兹猜想的时候,为了避免重复计算,可以记录下递推过程 ...
- mybatis中@Param用法
用注解来简化xml配置的时候,@Param注解的作用是给参数命名,参数命名后就能根据名字得到参数值,正确的将参数传入sql语句中 我们先来看Mapper接口中的@Select方法 package Ma ...
- 不同级域名中的 Cookie 共享
HTTP 响应头中 Set-Cookie 行未指定 domain 时则设置访问的域名 seliote.com 可以设置 seliote.com(也可以写成 .seliote.com 意思一样) 与 w ...
- java线程安全(单例模式)(转载)
原文链接:http://www.jameswxx.com/java/%E8%AF%B4%E8%AF%B4%E5%8D%95%E4%BE%8B%E6%A8%A1%E5%BC%8F/ 单例模式?多么简单! ...
- WPF仿QQ聊天框表情文字混排实现
原文:WPF仿QQ聊天框表情文字混排实现 二话不说.先上图 图中分别有文件.文本+表情.纯文本的展示,对于同一个list不同的展示形式,很明显,应该用多个DataTemplate,那么也就需要Data ...
- CodeForces 547E Mike and Friends AC自动机 主席树
题意: 给出\(n\)个字符串\(s_i\)和\(q\)个询问: \(l,r,k\):\(\sum\limits_{i=l}^{r}count(i, k)\),其中\(count(i,j)\)表示\( ...
- toolbar menu 字体颜色和大小
Toolbar菜单中menu当中我们大多数都使用图片来按钮,可是有些时候我们也会直接使用文字,文字的颜色如何修改呢. 其实很简单,我们只要修改styles.xml文件中,添加一句 <item n ...
- 【Deep Learning】林轩田机器学习技法
这节课的题目是Deep learning,个人以为说的跟Deep learning比较浅,跟autoencoder和PCA这块内容比较紧密. 林介绍了deep learning近年来受到了很大的关注: ...
- C++的字符输入
字符串的输入有6中方式,这六种方式各有各的特点,我这篇学习笔记是自己的经验总结,没有去探讨内存,函数库等的复杂问题,仅仅是为了实用: 第一:cin cin一次接受一个字符,所以有的人会选择定义一个字符 ...
- MySQL增强半同步几个重要参数搭配的测试
Preface Semi-synchronous replication is supported since MySQL 5.5 and then enhanced graduall ...