一.
安装zlib时代码
cd /lamp/zlib-1.2.3
./configure
make
make install
之后安装png,代码
cd /lamp/libpng-1.2.31
./configure --prefix=/usr/local/libpng
make
make install
在make时 便报错,如下
/lib/libz.a(crc32.o): relocation R_X86_64_32 against `.rodata‘ can not be used when 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[1]: *** [libpng12.la] Error 1
make[1]: Leaving directory `/lamp/libpng-1.2.31‘
make: *** [all] Error 2
解决方法如下:
cd zlib-1.2.3
//进入zlib目录
CFLAGS=
"-o3 -fPIC"
./configure
//使用64位元的方法进行编译
make
make install
make clean
转载:http://bbs.csdn.net/topics/390844865
二.
在安装jpeg6时出现如下错误:
[[email protected] jpeg-6b]# make
./libtool --mode=compile gcc -O2 -I. -c ./jcapimin.c
make: ./libtool:命令未找到
make: *** [jcapimin.lo] 错误 127
解决办法是:
从新安装libtool
wget http://ftp.gnu.org/gnu/libtool/libtool-2.2.6a.tar.gz
#./configure
#make
#make install >> a.log
安装后,查看安装日志 a.log如下:
/usr/bin/install -c ‘./libltdl/config/config.guess‘ ‘/usr/local/share/libtool/config/config.guess‘
/usr/bin/install -c ‘./libltdl/config/config.sub‘ ‘/usr/local/share/libtool/config/config.sub‘
config.guess和config.sub 安装目录在 /usr/local/share/libtool/config/下
#cd jpeg
#cp /usr/local/share/libtool/config/config.sub .
#cp /usr/local/share/libtool/config/config.guess .
也就是把 libtool里面的两个配置文件拿来覆盖掉jpeg-6b目录下的对应文件
make clean 再重新configure:/configure --prefix=/usr/local/jpeg --enable-shared //这里configure一定要带--enable-shared参数,不然,不会生成共享库