在Perl中安装GD.pm时启用PNG支持
发布时间:2020-12-16 06:15:44 所属栏目:大数据 来源:网络整理
导读:我已经安装了GD.pm.我想确保它支持PNG. 所以要检查我这样做: $perl -e 'use GD; $im=GD::Image-new(); print $im-can("png") ? "yes" : "no","n";'no 正如你看到的.它没有打印. 然后我通过以下过程从CPAN下载最新的GD: wget http://search.cpan.org/CPAN/
我已经安装了GD.pm.我想确保它支持PNG.
所以要检查我这样做: $perl -e 'use GD; $im=GD::Image->new(); print $im->can("png") ? "yes" : "no","n";' no 正如你看到的.它没有打印. > wget http://search.cpan.org/CPAN/authors/id/L/LD/LDS/GD-2.53.tar.gz > tar xvfz GD-2.53.tar.gz > cd GD-2.44 > perl Makefile.PL > make > make test > make install 我希望它包含这样的行,这是已安装的PNG支持的标志: Included Features: GD_XPM GD_JPEG GD_FONTCONFIG GD_FREETYPE GD_PNG GD_GIF GD_GIFANIM GD_OPENPOLYGON GD_UNCLOSEDPOLY GD_ANIMGIF GD_FTCIRCLE VERSION_33 但相反,我只得到了这个: Included Features: GD_GIF GD_GIFANIM GD_OPENPOLYGON 我没有成功使用这个命令sudo perl Makefile.PL -options“JPEG,FT,PNG”. 在PNG支持下安装GD.pm的方法是什么? 我需要它来运行circos. 更新: 安装libpng并重建GD后 $brew update && brew upgrade $brew install gd $brew install libpng $sudo cpan cpan > force install GD 建议,我得到这个错误: $perl -e 'use GD; $im=GD::Image->new(); print $im->can("png") ? "yes" : "no","n";' Can't load '/Library/Perl/5.16/darwin-thread-multi-2level/auto/GD/GD.bundle' for module GD: dlopen(/Library/Perl/5.16/darwin-thread-multi-2level/auto/GD/GD.bundle,1): Library not loaded: libpng15.15.dylib Referenced from: /usr/local/lib/libfreetype.6.dylib Reason: image not found at /System/Library/Perl/5.16/darwin-thread-multi-2level/DynaLoader.pm line 194. at -e line 1. Compilation failed in require at -e line 1. BEGIN failed--compilation aborted at -e line 1. 更新2: $ locate libpng15.15.dylib /anaconda/lib/libpng15.15.dylib /anaconda/pkgs/libpng-1.5.13-1/lib/libpng15.15.dylib /opt/X11/lib/libpng15.15.dylib /opt/local/lib/libpng15.15.dylib $ln -s /opt/X11/lib/libpng15.15.dylib /usr/local/lib/libpng15.15.dylib $perl -e 'use GD; $im=GD::Image->new(); print $im->can("png") ? "yes" : "no","n";' yes 解决方法
在制作GD.pm之前,您需要库作为依赖项.在这个特殊情况下,libpng显然是缺失的.
由于这种依赖性,如果您的perl是您的操作系统附带的perl,我建议您使用包管理器而不是CPAN: > OS X的MacPorts或自制程序> apt-get for Debian和Ubuntu.> yum for RHEL,Cent-OS. (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |