/usr/local/lib/libz.a: could not read symbols: Bad value(64 位 Linux)
2014-11-13 14:07
465 查看
/usr/local/lib/libz.a: could not read symbols: Bad value(64 位 Linux)
/usr/bin/ld: /usr/local/lib/libz.a(crc32.o): relocation R_X86_64_32 against `a local symbol' can not be used when making a shared object; recompile with -fPIC/usr/local/lib/libz.a: could not read symbols: Bad value
一般是64 位 电脑才会出现。
解决方法如下:
cd zlib-1.2.3 //进入zlib目录
CFLAGS="-O3 -fPIC" ./configure //使用64位元的方法进行编译
make
make install
make clean
上面操作演示结果如下:
[root@unix-server1 zlib-1.2.3]# CFLAGS="-O3 -fPIC" ./configure --prefix=/usr/local/zlib/
Checking for gcc...
Building static library libz.a version 1.2.3 with gcc.
Checking for unistd.h... Yes.
Checking whether to use vs
printf() or s
printf()... using vs
printf()
Checking for vsnprintf() in stdio.h... Yes.
Checking for return value of vsnprintf()... Yes.
Checking for errno.h... Yes.
Checking for mmap support... Yes.
[root@unix-server1 zlib-1.2.3]# make
gcc -O3 -fPIC -DUSE_MMAP -c -o example.o example.c
gcc -O3 -fPIC -DUSE_MMAP -c -o adler32.o adler32.c
gcc -O3 -fPIC -DUSE_MMAP -c -o compress.o compress.c
gcc -O3 -fPIC -DUSE_MMAP -c -o crc32.o crc32.c
gcc -O3 -fPIC -DUSE_MMAP -c -o gzio.o gzio.c
gcc -O3 -fPIC -DUSE_MMAP -c -o uncompr.o uncompr.c
gcc -O3 -fPIC -DUSE_MMAP -c -o deflate.o deflate.c
gcc -O3 -fPIC -DUSE_MMAP -c -o trees.o trees.c
gcc -O3 -fPIC -DUSE_MMAP -c -o zutil.o zutil.c
gcc -O3 -fPIC -DUSE_MMAP -c -o inflate.o inflate.c
gcc -O3 -fPIC -DUSE_MMAP -c -o infback.o infback.c
gcc -O3 -fPIC -DUSE_MMAP -c -o inftrees.o inftrees.c
gcc -O3 -fPIC -DUSE_MMAP -c -o inffast.o inffast.c
ar rc libz.a adler32.o compress.o crc32.o gzio.o uncompr.o deflate.o trees.o zutil.o inflate.o infback.o inftrees.o inffast.o
gcc -O3 -fPIC -DUSE_MMAP -o example example.o -L. libz.a
gcc -O3 -fPIC -DUSE_MMAP -c -o minigzip.o minigzip.c
gcc -O3 -fPIC -DUSE_MMAP -o minigzip minigzip.o -L. libz.a
[root@unix-server1 zlib-1.2.3]# make install
cp zlib.h zconf.h /usr/local/zlib//include
chmod 644 /usr/local/zlib//include/zlib.h /usr/local/zlib//include/zconf.h
cp libz.a /usr/local/zlib//lib
cd /usr/local/zlib//lib; chmod 755 libz.a
cd /usr/local/zlib//lib; if test -f libz.so.1.2.3; then \
rm -f libz.so libz.so.1; \
ln -s libz.so.1.2.3 libz.so; \
ln -s libz.so.1.2.3 libz.so.1; \
(ldconfig || true) >/dev/null 2>&1; \
fi
cp zlib.3 /usr/local/zlib//share/man/man3
chmod 644 /usr/local/zlib//share/man/man3/zlib.3
[root@unix-server1 zlib-1.2.3]# make clean
rm -f *.o *~ example minigzip \
libz.* foo.gz so_locations \
_match.s maketree contrib/infback9/*.o
[root@unix-server1 zlib-1.2.3]#
相关文章推荐
- /usr/local/lib/libz.a: could not read symbols: Bad value(64 位 Linux)
- /usr/local/lib/libz.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
- php make报错:/usr/local/openssl/lib/libssl.a: could not read symbols: Bad value
- /usr/local/lib/libltdl.a(ltdl.o): could not read symbols: Bad value
- R_X86_64_32 & could not read symbols: Bad value编译
- make error: libneon.a: could not read symbols: Bad value
- /usr/local/lib/libpython2.7.a: could not read symbols: Bad value. collect2: ld retur ned 1 exit
- R_X86_64_32 & could not read symbols: Bad value
- apache 在 加载openssl 模块时出现 “/usr/local/ssl/lib/libssl.a: could not read symbols: Bad value”错误解决方案
- htslib库安装过程中的编译错误,libz.a: could not read symbols: Bad value
- /usr/lib/libexpat.so: could not read symbols解决方法
- 安装ucspi-tcp的时候出现报错:/lib64/libc.so.6: could not read symbols: Bad value
- /usr/lib/libexpat.so: could not read symbols解决方法
- linux下安装subversion报错:/usr/local/zlib//lib/libz.a(compress.o): relocation R_X86_64_32 against `.rodat
- TTserver 编译/usr/local/lib/libbz2.a: could not read symbols: Bad value解决
- 解决 liblog4cpp.a: could not read symbols: Bad value
- 动态库编译时(引用静态库)could not read symbols: Bad value
- Apache 安装过程中出错/usr/lib/libexpat.so: could not read symbols: File in wrong format的解决办法