---
title: "CentOS5.6安装libpng提示--configure: error: ZLib not installed"
author: "yangyz1984"
date: "2011-07-28T21:20:14Z"
tags: []
categories: ["操作系统"]
slug: "centos5-6-libpng-configure-error-zlib-not-installed"
draft: false
lastmod: "2011-07-28T21:20:14Z"
id: 1135181
url: "https://yyzstudy.iteye.com/blog/1135181"
---

在CentOS5.6下安装libpng
./configure --prefix=/usr/local/libpng
提示：

configure: error: ZLib not installed

我从网上找了一些方式，比如说指定--with-zlib=/usr/local/你编译的路径，结果还是提示上面的错误。

最后的解决方法是：

1.进入zlib的源文件目录，执行命令 make clean,清除zlib；

2.重新配置 ./configure,后面不要接--prefix参数；

3.编辑 && 安装；

4.进入libpng目录，执行命令 ./configure --prefix=/usr/local/libpng;

5.编译 && 安装；

6.安装成功；