Why do I get "Could not find gdlib-config in the search path" when I try to install GD::Polygon, even though gdlib-config is installed?

Floran Gmehlin picture Floran Gmehlin · Jun 21, 2016 · Viewed 8.2k times · Source

I'm trying to install GD::Polygon by running cpan install GD::Polygon, but I get the following error:

**UNRECOVERABLE ERROR**
Could not find gdlib-config in the search path. Please install libgd 
2.0.28 or higher.

I manually installed libgd-2.2.1 from source (./configure, make, make install) and now when I run whereis gdlib-config, I see that it is indeed installed:

gdlib-config: /usr/local/bin/gdlib-config

How can I tell cpan where to find this library?

Answer

Floran Gmehlin picture Floran Gmehlin · Jun 21, 2016

Well, short answer is : I installed GD via yum instead of cpan.

sudo yum install perl-GD

If you still want to install it through cpan, you should include gdlib-config on your PATH (not just the folder e.g. /usr/local/bin or wherever it is).

Installing Perl packages with yum is definitively better than with cpan