【安装】
参考:http://blog.csdn.net/aa1600159112/article/details/76664566
下载:http://sourceforge.net/projects/libpng/
实证版本:libpng-1.6.21
最新版本:libpng-1.6.32
wget https://jaist.dl.sourceforge.net/project/libpng/libpng16/older-releases/1.6.21/libpng-1.6.21.tar.gz && tar -zxvf libpng-1.6.21.tar.gz && cd libpng-1.6.21 && ./configure --prefix=/usr/local/png --enable-shared LDFLAGS="-L/usr/lib -lz" && make && make install
输出:
... Libraries have been installed in: /usr/local/png/lib ...
更新系统动态连接库配置:
echo /usr/local/png/lib >> /etc/ld.so.conf && ldconfig
编译安装完成。
【排错】
如果 make 时报错:
./.libs/libpng16.so: undefined reference to `inflateValidate'
参考:https://www.queryxchange.com/q/1_831680/libpng16-so-undefined-reference-to-inflatevalidate-39/
参考:https://serverfault.com/questions/831680/libpng16-so-undefined-reference-to-inflatevalidate/831681