一. 安装libpng库前需要先安装zlib库,libpng库依赖zlib库
1.1. zlib库安装
1.1.1. 下载地址:http://www.zlib.net/
1.1.2. 解压后得到zlib-1.2.8文件夹(视版本而不同)
jpeg- libpng-1.6. zlib-1.2.
jpegsrc.v9.tar.gz libpng-1.6..tar.gz zlib-1.2..tar.gz
1.1.3. 配置zlib
root@ubuntu:~/decodeporting# export CC=arm-linux-gcc
root@ubuntu:~/decodeporting# ./configure
1.1.4. make
1.1.5. make install
root@ubuntu:~/decodeporting/zlib-1.2.# make install
cp libz.a /usr/local/lib
chmod /usr/local/lib/libz.a
cp libz.so.1.2. /usr/local/lib
chmod /usr/local/lib/libz.so.1.2.
cp zlib. /usr/local/share/man/man3
chmod /usr/local/share/man/man3/zlib.
cp zlib.pc /usr/local/lib/pkgconfig
chmod /usr/local/lib/pkgconfig/zlib.pc
cp zlib.h zconf.h /usr/local/include
chmod /usr/local/include/zlib.h /usr/local/include/zconf.h
二. libpng库安装
2.1. libpng库安装
2.1.1. 下载地址:https://sourceforge.net/projects/libpng/files/libpng16/1.6.34/libpng-1.6.34.tar.xz/download
2.1.2. 解压后得到libpng-1.6.7文件夹(视版本而不同)
jpeg- libpng-1.6. zlib-1.2.
jpegsrc.v9.tar.gz libpng-1.6..tar.gz zlib-1.2..tar.gz
2.1.3. 配置libpng
./configure --host=arm-linux --prefix=$PWD/temp_install CC=arm-linux-gcc LIBS=-L/usr/local/lib CPPFLAGS=-I/usr/local/include
注意:LIBS和CPPFLAGS这两个参数要好zlib的安装目录一致
2.1.4. make
2.1.5. make install