动态库编译时(引用静态库)could not read symbols: Bad value
来源:互联网 发布:网络招商平台 编辑:程序博客网 时间:2024/06/13 21:17
编译动态库时遇到relocation R_X86_64_32 against `a local symbol'的错误
编译动态库时遇到如下错误:
I'm Trying to Link a static Library to a shared library , I'm Getting the Following error
/usr/bin/ld: ../../../libraries/log4cplus/liblog4cplus.a(fileappender.o): relocation R_X86_64_32S against `a local symbol' can not be used when making a shared object; recompile with -fPIC../../../libraries/log4cplus/liblog4cplus.a: could not read symbols: Bad valuecollect2: ld returned 1 exit status
Assuming you are generating a shared library, most probably what happens is that the variant of liblog4cplus.a
you are using wasn't compiled with -fPIC
. In linux, you can confirm this by extracting the object files from the static library and checking their relocations:
ar -x liblog4cplus.a readelf --relocs fileappender.o | egrep '(GOT|PLT|JU?MP_SLOT)'
If the output is empty, then the static library is not PIC and cannot be used to generate a shared object.
Since the static library contains object code which was already compiled, providing the -fPIC flag won't help.
You need to get ahold of a version of liblog4cplus.a
compiled with -fPIC
and use that one instead.
0 0
- 动态库编译时(引用静态库)could not read symbols: Bad value
- R_X86_64_32 & could not read symbols: Bad value编译
- R_X86_64_32 & could not read symbols: Bad value
- TTserver 编译/usr/local/lib/libbz2.a: could not read symbols: Bad value解决
- make error: libneon.a: could not read symbols: Bad value
- 解决 liblog4cpp.a: could not read symbols: Bad value
- php make报错:/usr/local/openssl/lib/libssl.a: could not read symbols: Bad value
- /usr/local/lib/libz.a: could not read symbols: Bad value
- recompile with -fPIC /usr/local/lib/libboost_python.a: could not read symbols: Bad value
- CentOS6升级openssl报错libcrypto.a(rsaz_exp.o): could not read symbols: Bad value
- 在Linux动态库Project中链接静态库时,遇到error adding symbols: Bad value的问题
- apache 在 加载openssl 模块时出现 “/usr/local/ssl/lib/libssl.a: could not read symbols: Bad value”错误解决方案
- 安装ucspi-tcp的时候出现报错:/lib64/libc.so.6: could not read symbols: Bad value
- /usr/local/lib/libpython2.7.a: could not read symbols: Bad value. collect2: ld retur ned 1 exit
- libpcap库在64位系统上编译产生错误原因:Could not read symbols:?
- Could not read symbols解决方法
- Could not read symbols解决方法
- Could not read symbols解决方法
- HDU4969 物理 Just a Joke
- 获取本机端口
- hdu 4970
- org.apache.catalina.util.DefaultAnnotationProcessor cannot be cast to org.ap
- HDU 4970 Killing Monsters 【搜索】
- 动态库编译时(引用静态库)could not read symbols: Bad value
- hdu 3123 GCC (2009 Asia Wuhan Regional Contest Online)
- 自定义对话框样式
- Jobdu 题目1154:Jungle Roads
- 算法竞赛入门经典完整版 7.1.3 分数拆分
- BestCoder Round #4(Miaomiao's Geometry-贪心)
- poj3517 And Then There Was One(约瑟夫环)
- android开发笔记之browser 获取view对象的缩略图
- jquery实现输入框增加分隔符 jquery.formatInput