标签:against symbols making shared status
场景:
二进制Link-->动态库-->第三方静态库
Linux环境中需要动态库链接第三方的静态库
错误:
/usr/bin/ld: ../../3rdpart/x64/muduo/lib/libbase.a(AsyncLogging.o): relocation R_X86_64_32 against `.rodata‘ can not be used when making a shared object; recompile with -fPIC
../../3rdpart/x64/muduo/lib/libbase.a: could not read symbols: Bad value
collect2: error: ld returned 1 exit status
解决方法:
重新编译静态库第三方的静态库
在makefile 中添加-fPIC
查看编译期参数是否缺少 -fPIC , 不仅是共享库,静态库有时也需要有 -fPIC参数
本文出自 “None” 博客,请务必保留此出处http://evely.blog.51cto.com/1089422/1921223
标签:against symbols making shared status
原文地址:http://evely.blog.51cto.com/1089422/1921223