一、背景

编译第三方库A的时候提示依赖openssl库。

二、编译openssl库

去官网下载最新版本的openssl-1.0.2l.tar.gz
tar -zxvf openssl-1.0.2l.tar.gz
cd openssl-1.0.2l

./config
make
make install

完成编译,默认openssl的库安装在/usr/local/ssl目录下。

三、引用openssl库

第三方库【A】编译引用openssl的时候(make的时候),提示这个错误:

/usr/local/ssl/lib/libssl.a: error adding symbols: Bad value

四、基本原理

我们都知道在生成一个动态库时需要指定-fPIC,这是创建动态库所要求的,共享库被加载是在内存中的位置是不固定的,是一个相对的位置。
那么在生成静态库时通常不指定-fPIC, 可是在64bit编译使用静态库就会提示需要-fPIC重新编译该库。
由于openssl编译静态库时,没有使用-fPIC选项,使得编译出来的静态库没有重定位能力。
这样在64bit机器上编译出来的静态库如果不指定-fPIC选项几乎全部不能使用。
因此需要重新加上-fPIC从新编译openssl

五、重新编译

./config -fPIC
make depend
make install

六、注意

删除openssl-1.0.2l,重新解压。
因为编译过的环境里执行【重新编译】动作看起来无效。

七、测试

再make第三方库【A】的时候,没有报错,编译通过。

使用其他静态库遇到类似问题,此方法同样适用。

/usr/local/ssl/lib/libssl.a: error adding symbols: Bad value的更多相关文章

  1. qt opencv编译错误 /usr/local/lib/libopencv_imgcodecs.so.3.1:-1: error: error adding symbols: DSO missing from command line

    转载自:http://tbfungeek.github.io/2016/03/05/Opencv-%E5%AE%89%E8%A3%85%E8%BF%87%E7%A8%8B%E4%B8%AD%E5%87 ...

  2. Corrupted MAC on input at /usr/local/perl/lib/site_perl/5.22.1/x86_64-linux/Net/SSH/Perl/Packet.pm l

    <pre name="code" class="python">[Thu May 5 11:02:27 2016] [error] Corrupte ...

  3. 通过离线安装包解决了 from cryptography.hazmat.bindings._openssl import ffi, lib ImportError: /usr/local/python36/lib/python3.6/site-packages/cryptography-2.2.2-py3.6-linux-x86_64.egg/cryptography/hazmat/binding

    场景:内网服务器不能上外网(代理也不通!), 之前安装了PYTHON的几个安装包,但不是知道为什么无法使用PARAMIKO这个模块 在导入 from cryptography.hazmat.bindi ...

  4. PHP启动:动态库加载失败(PHP Warning: PHP Startup: Unable to load dynamic library '/usr/local/php7/lib/php/extensions/no-debug-non-zts-20151012/*.so')

    今天在linux上面智障一般搞了好久,本来想安装个swoole的,然后用  php -m 的命令想看下安装的PHP扩展库,发现有的扩展库有的可以出来,有的加载失败, 加载失败的错误类型: PHP Wa ...

  5. 【Python MySQLdb】Library not loaded: /usr/local/mysql/lib/libmysqlclient.20.dylib解决办法

    使用MySQLdb遇到以下错误 ImportError: dlopen(/Users/jackey/Documents/Xiaomi/Code/wda_python/lib/python2./site ...

  6. ImportError: /lib64/libm.so.6: version `GLIBC_2.23' not found (required by /usr/local/python37/lib/python3.7/site-packages/tensorflow/python/_pywrap_tensorflow_internal.so)

    一 问题背景 这个错误的出现往往与我前面的一篇文章 ImportError: /lib64/libm.so.6: version `CXXAB_1.3.8.' not found (required ...

  7. error adding symbols: DSO missing from command line collect2: error: ld returned 1 exit status

    Windows服务器Azure云编译安装MariaDB教程 www.111cn.net 编辑:future 来源:转载 安装MariaDB数据库最多用于linux系统中了,下文给各位介绍在Window ...

  8. GLFW3出error adding symbols: DSO missing from command line解决

    背景:使用OpenGL的GLFW3.1库的时候,使用其中一些代码 报error adding symbols: DSO missing from command line 因为使用的是Qcreator ...

  9. ImportError: /lib64/libm.so.6: version `CXXAB_1.3.8.' not found (required by /usr/local/python37/lib/python3.7/site-packages/tensorflow/python/_pywrap_tensorflow_internal.so)

    问题背景 使用在AI项目中,由于需要用到tensorflow,scipy,sklearn等这些库,所以需要libstdc++库. 问题原因 这个问题的出现与写的代码无关,只与操作系统的libstdc+ ...

随机推荐

  1. ElementUI的提示框的使用记录

    1.popover点击之后隐藏 问题描述:做了一个通知面板功能,下面提示信息有路由,每次点击消息呢,就跳转到了路由页面,但是此时这个面板没关闭,希望将其关闭 解决:官方文档有个属性 <div&g ...

  2. hdu 4491 Windmill Animation

    A windmill animation works as follows: A two-dimensional set of points, no three of which lie on a l ...

  3. 6. Activity life cycle

    An activity can exist in essentially three states: Resumed The activity is in the foreground of the ...

  4. python使用md5处理下载图片

    import urllib2 import hashlib opener = urllib2.build_opener() req = opener.open("http://avatar. ...

  5. IE 之 应用小结

    1. 导出收藏夹(IE11) 导出:打开浏览器, 文件(F) → 导入和导出(M)... → 导出到文件(E) → 指定导出内容 → 指定保存路径导入:打开浏览器,文件(F) → 导入和导出(M).. ...

  6. glassfish--服务搭建

    集群配置: 1. DAS节点执行: 1)./asadmin start-domain domain1 2)./asadmin change-admin-password 3)./asadmin ena ...

  7. 子查询一(WHERE中的子查询)

    子查询 子查询就是指的在一个完整的查询语句之中,嵌套若干个不同功能的小查询,从而一起完成复杂查询的一种编写形式,为了让读者更加清楚子查询的概念. 子查询返回结果子查询可以返回的数据类型一共分为四种: ...

  8. MySQL单列索引和组合索引(联合索引)的区别详解

    发现index merge局限性,优化器会自动判断是否使用 index merge 优化技术,查询还是需要组合索引[推荐阅读:对mysql使用索引的误解] MySQL单列索引和组合索引(联合索引)的区 ...

  9. Linux 小知识点

    1:当前目录比较重要的几个文件 . .. anaconda-ks.cfg .bash_history .bash_logout .bash_profile .bashrc .cshrc install ...

  10. jprofiler_windows-x64_9_1注册码

    L-Larry_Lau@163.com#5481-ucjn4a16rvd98#6038 L-Larry_Lau@163.com#36573-fdkscp15axjj6#25257