分类: LINUX
2009-05-11 20:12:26
-- 解决安装php时的/usr/local/lib/libz.a(compress.o)错误
CFLAGS="-O3 -fPIC" ./configure
在安装 php 时,需要先安装 gd-2.0.33.tar.gz, 但在编译php时出现了如下错误:
/usr/local/lib/libz.a: could not read symbols: Bad value.
详细信息:
making a shared object; recompile with -fPIC
/usr/local/lib/libz.a: could not read symbols: Bad value
collect2: ld returned 1 exit status
make[2]: *** [libgd.la] 错误 1
make[2]: Leaving directory `/usr/local/src/gd-2.0.33'
make[1]: *** [all-recursive] 错误 1
make[1]: Leaving directory `/usr/local/src/gd-2.0.33'
make: *** [all] 错误 2
解决办法: 重新安装重新编译 zlib即可!
[root@localhost~] tar -zxvf zlib-1.2.3.tar.gz
[root@localhost~] cd zlib-1.2.3
[root@localhost ] CFLAGS="-O3 -fPIC" ./configure --prefix=/usr/local/zlib
[root@localhost ] make
[root@localhost ] make install
/usr/bin/ld: /usr/local/lib/libz.a(compress.o): relocation R_X86_64_32 against `a local symbol'
类似上面原因一般都是由于调用库非64位导致!