1
共享库,我有两个基于autotools的项目AAA和BBB:对链接的静态库
- AAA是建立与 “--enable-静态--disable共享”,用C语言编写 所有代码
- BBB是一个动态库,以及对AAA环节使用 “libBBB_la_LIBADD = /path/to/libAAA.a”
我越来越想要编译BBB时,以下几点:
/usr/bin/ld: /usr/local/lib/libAAA.a(liboAAA_la-foo.o): relocation R_X86_64_PC32 against undefined symbol `[email protected]@GLIBC_2.2.5' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: final link failed: Bad value
供参考,这是产生错误的实际的命令是:
gcc -shared -fPIC -DPIC .libs/libBBB_la-BBB.o .libs/libBBB_la-hash.o .libs/libBBB_la-vl_helpers.o -lm -L/usr/local/lib /usr/local/lib/libAAA.a -O3 -Wl,-soname -Wl,libBBB.so.0 -o .libs/libBBB.so.0.0.0
我在做什么错了,我该如何使这项工作?