简体   繁体   中英

Not able to install GD module in Perl

I am not able to install GD module in PErl. I have done CPAN GD but that gives me error:

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

and whenever I run my file it gives:

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. 

Also i have seen this solution of running sudo apt-get install libgd2-xpm-dev but this says

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

I am using Ubuntu 18.04

您需要安装libgd-dev

$ sudo apt-get install libgd-dev

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM