一、背景

编译第三方库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. c++call back

    #include "stdafx.h" struct A; typedef void(A::*MemFuncPtr) (int* e); class A { int a; }; c ...

  2. 遇到问题描述:Android Please ensure that adb is correctly located at问题解决

    遇到问题描述: 运行android程序控制台输出 [2013-11-04 16:18:26 - ] The connection to adb is down, and a severe error ...

  3. Web.config中加了system.diagnostics节点后就不能访问了

    Web.config中加了system.diagnostics节点后就不能访问了,怎么回事? [解决方法] 不要把system.diagnostics节点作为web.config的第一个节点.

  4. [jQuery] Custom event trigger

    $(document).ready(function(){ // Get Weather $('button').on('show.weather', function() { var results ...

  5. 2. Using 'dp' instead of 'px' to set text size

    android:textSize="45px"  ==> android:textSize="45dp" 因为Android Phone的手机分辨率各不相 ...

  6. Linux:编译动态库时遇到的错误relocation R_X86_64_32 against `a local symbol'

    编译动态库时遇到如下错误: ... ... relocation R_X86_64_32 against `a local symbol' can not be used when making a ...

  7. Bootstrap3实现的响应式幻灯滑动效果个人作品集/博客网站模板

    ​在线演示 本地下载 如果你想学习如何开发和使用的话,请参考我们免费的课程: Bootstrap3开发滑动风格的博客网站模板

  8. Android Environment.getExternalStorageDirectory() 获取的是内部存储还是外部存储?

    这几天在做Android应用的远程更新功能,将下载的更新包放在移动设备上指定的文件夹. 用的是  Environment.getExternalStorageDirectory() 这种方法.然后在获 ...

  9. STL - 容器 - Forward List

    forward list是一个行为受限的list, 不能走回头路. 它只提供前向迭代器, 而不提供双向迭代器. eg: rbegin(), rend(), crbegin(), crend()这些都不 ...

  10. curl_errno错误码说明

    http://hi.baidu.com/lifang218c/item/fa80496eb4cf262f68105b50 http://blog.csdn.net/cwj649956781/artic ...