Chinaunix首页 | 论坛 | 博客
  • 博客访问: 857909
  • 博文数量: 254
  • 博客积分: 5350
  • 博客等级: 大校
  • 技术积分: 2045
  • 用 户 组: 普通用户
  • 注册时间: 2008-06-27 13:27
文章分类

全部博文(254)

文章存档

2015年(1)

2014年(9)

2013年(17)

2012年(30)

2011年(150)

2010年(17)

2009年(28)

2008年(2)

分类: LINUX

2011-03-31 14:55:33

在CentOS5.4下安装libpng
./configure --prefix=/usr/local/libpng
提示:

configure: error: ZLib not installed


在装libpng之前,我先装了zlib。可为什么还是提示找不到呢?
我接着查了资料,有文档说libpng不用configure,是拷贝scripts/makefile.linux
我又执行如下命令:
cp scripts/makefile.linux makefile
make
结果,,出错更多了,。。

最后的解决方案是:

1.进入zlib的源文件目录,执行命令 make clean,清除zlib;

2.重新配置 ./configure,后面不要接--prefix参数;

3.编辑 && 安装;

4.进入libpng目录,执行命令 ./configure --prefix=/usr/local/libpng;

5.编译 && 安装;

6.安装成功;


問題:

還有報錯:

[root@localhost libpng-1.5.1]# yum list |grep zlib
zlib.i386                                  1.2.3-3                     installed
zlib.x86_64                                1.2.3-3                     installed
zlib-devel.i386                            1.2.3-3                     installed
zlib-devel.x86_64                          1.2.3-3                     installed
這個yum安裝的zlib也在編譯安裝libpng時不起作用。必須要用源碼再裝一次。

如果有報錯誤

usr/bin/ld: /usr/local/lib/libz.a(compress.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
------------------------------------------------

是缺少zlib-devel這個包,安裝即可。

阅读(1527) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~