首页 > 解决方案 > 无法在 Perl 中安装 GD 模块

问题描述

我无法在 PErl 中安装 GD 模块。我已经完成了 CPAN GD 但这给了我错误:

Reading '/home/harsh/.cpan/Metadata'
  Database was generated on Mon, 28 Sep 2020 02:17:03 GMT
Running install for module 'GD'
Checksum for /home/harsh/.cpan/sources/authors/id/R/RU/RURBAN/GD-2.73.tar.gz ok
'YAML' not installed, will not store persistent state
Configuring R/RU/RURBAN/GD-2.73.tar.gz with Makefile.PL
Notice: Type perl Makefile.PL -h for command-line option summary.

Package gdlib was not found in the pkg-config search path.
Perhaps you should add the directory containing `gdlib.pc'
to the PKG_CONFIG_PATH environment variable
No package 'gdlib' found
 at Makefile.PL line 451.
*** can not find package gdlib
*** check that it is properly installed and available in PKG_CONFIG_PATH
 at Makefile.PL line 451.
Warning: No success on command[/home/harsh/perl5/perlbrew/perls/perl-5.28.0/bin/perl Makefile.PL]
  RURBAN/GD-2.73.tar.gz
  /home/harsh/perl5/perlbrew/perls/perl-5.28.0/bin/perl Makefile.PL -- NOT OK

每当我运行我的文件时,它都会给出:

Can't locate GD.pm in @INC (you may need to install the GD module) (@INC contains: /home/harsh/perl5/perlbrew/perls/perl-5.28.0/lib/site_perl/5.28.0/x86_64-linux /home/harsh/perl5/perlbrew/perls/perl-5.28.0/lib/site_perl/5.28.0 /home/harsh/perl5/perlbrew/perls/perl-5.28.0/lib/5.28.0/x86_64-linux /home/harsh/perl5/perlbrew/perls/perl-5.28.0/lib/5.28.0) at generate_feedburner_graph.perl line 18.
BEGIN failed--compilation aborted at generate_feedburner_graph.perl line 18. 

我也看到了这个运行 sudo apt-get install libgd2-xpm-dev 的解决方案,但这说

Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package libgd2-xpm-dev

我正在使用 Ubuntu 18.04

标签: perlgd

解决方案


您需要安装libgd-dev

$ sudo apt-get install libgd-dev

推荐阅读