Installing the libpng under CentOS5.4
./configure--prefix=/usr/local/libpng
Tips:
Configure:error:ZLib not installed
Before I installed the libpng, I installed the zlib first. But why are you still suggesting that you can't find them?
I went on to check the information, there is a document that libpng not configure, is a copy scripts/makefile. Linux
I also execute the following command:
CP Scripts/makefile.linux Makefile
Make
As a result, there are more errors,..
The Final Solution is:
1. Enter the source file directory of the zlib, execute the command make clean, clear the zlib;
2. Reconfigure./configure, do not answer the--prefix parameter;
3. Edit && Install;
4. Enter the Libpng directory and execute the command./configure--prefix=/usr/local/libpng;
5. Compile && install;
6. Installation success;
The first step:
cd/usr/local/src/
Tar zxvf zlib-1.2.3.tar.gz
CD zlib-1.2.3
./configure--prefix=/usr/local #注意: This place cannot be written./configure--prefix=/usr/local/zlib otherwise install libpng times wrong.
Make
Make install
Step Two:
cd/usr/local/src/
Tar zxvf libpng-1.2.31.tar.gz
CD libpng-1.2.31
./configure--prefix=/usr/local/libpng
Make
Make install
If you prefix= the specified directory during the compilation and installation of Zlib,
You won't find zlib when you install libpng.
The most important thing in solving this problem is that libpng is not configure, because Makefile is already available in the scripts directory, so it is not necessary to use configure to create the Makefle file.
Copy the Scripts directory Makefile.linux to the source package root directory, and make it directly.
However, in order to solve the above problem can not find zlib, need to modify the makefile file.
Makefile Find the zlib related two lines, modify the actual zlib/lib and Zlib/include, and then look up to find the prefix item, modify the directory you want to prefix. This allows both zlib and libpng to customize the directory installation. 、
Installing libpng
TAR-JXFV LIBPNG-1.2.10.TAR.GZ2
CD libpng-1.2.10
CP Scripts/makefile.linuxmakefile
Make
Make install
Note: The makefile here is not generated by./configure, but is copied directly from the script/directory.
At the end of this step, Libpng was installed under/usr/local/lib
Installation libpng Configure:error:ZLib not installed and ZLib custom directory installation, the solution of libpng problem cannot be found when compiling ZLib