码迷,mamicode.com
首页 > 系统相关 > 详细

linux编译动态库时,libcrypto.a 提示recompile with -fPIC

时间:2018-06-25 13:10:29      阅读:1231      评论:0      收藏:0      [点我收藏+]

标签:动态库   网上   make   local   nss   g++   /usr   配置   pil   

/usr/bin/ld: /usr/local/ssl/lib/libcrypto.a(x86_64cpuid.o): relocation R_X86_64_PC32 against `OPENSSL_cpuid_setup‘ can not be used when making a shared object; recompile with -fPIC

##g++编译动态库时,使用了ssl的静态库/usr/local/ssl/lib/libcrypto.a,结果一直报上面的错误
用openssl0.9.8的的源码重新编译该库,还是报同样的错误,网上搜索了一番,发现正确的编译ssl的流程是
./config -fPIC
make
make install
由于我一直用的./config直接配置,没有加后面的参数,所以使用时一直报错。
其实报错已经提示了缺少-fPIC,但是一直没仔细研究过
加上参数后重新编译ssl库,就可以了

linux编译动态库时,libcrypto.a 提示recompile with -fPIC

标签:动态库   网上   make   local   nss   g++   /usr   配置   pil   

原文地址:http://blog.51cto.com/pvqvv/2132346

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!