为什么当我尝试安装 GD::P olygon,即使安装了 gdlib-config,我也会"Could not find gdlib-config in the search path"?



我正在尝试通过运行cpan install GD::Polygon安装GD :: Polygon,但是我会收到以下错误:

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

i从源(./configuremakemake install)手动安装了libgd-2.2.1,现在在运行whereis gdlib-config时,我确实已经安装了它:

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

如何告诉cpan在哪里可以找到此库?

好吧,简短的答案是:我通过yum而不是cpan安装了GD。

sudo yum install perl-GD

如果您仍然想通过cpan安装它,则应在路径上包括gdlib-config(不仅是文件夹,例如/usr/local/bin或任何地方)。

使用yum安装PERL软件包比cpan

确定要好

我同意使用软件包管理器。您没有提及使用哪个操作系统。在ubuntu linux上,/usr/local/bin也处于root用户的路径中。您可以仔细检查文件是否可执行。

还确保执行perl编译的脚本不会弄乱路径变量。

我正在使用perlbrew,并且不用作为root运行,使用CPAN安装东西。注意:在Ubuntu 16.10和17.04上,Gdlib-Config缺少,因为Debian维护者似乎已将其删除。

要获得它,您可以在此处编译源:https://launchpad.net/ubuntu/archive/primary/files/libgd2_2.1.1.orig.tar.gz

使用以下补丁:

diff webpimg.c.org libgd-gd-2.1.1-patched-16.10plus/src/webpimg.c
714c714
<     vpx_img_wrap(&img, IMG_FMT_I420,
---
>     vpx_img_wrap(&img, VPX_IMG_FMT_I420,
716,721c716,721
<     img.planes[PLANE_Y] = (uint8*)(Y);
<     img.planes[PLANE_U] = (uint8*)(U);
<     img.planes[PLANE_V] = (uint8*)(V);
<     img.stride[PLANE_Y] = y_stride;
<     img.stride[PLANE_U] = uv_stride;
<     img.stride[PLANE_V] = uv_stride;
---
>     img.planes[VPX_PLANE_Y] = (uint8*)(Y);
>     img.planes[VPX_PLANE_U] = (uint8*)(U);
>     img.planes[VPX_PLANE_V] = (uint8*)(V);
>     img.stride[VPX_PLANE_Y] = y_stride;
>     img.stride[VPX_PLANE_U] = uv_stride;
>     img.stride[VPX_PLANE_V] = uv_stride;

欢呼

顺便说一句,似乎CPAN安装程序只需要一个" DEVEL"版本的LibGD来构建软件包。我尝试将其安装在旧的cygwin板块上,并最终与" libgd-devel"组件一起使用。

我尝试使用以下代码安装libbgd。在将libgd-2.2.5/bin路径添加到 $PATH之后,它起作用。

wget https://github.com/libgd/libgd/releases/download/gd-2.2.5/libgd-2.2.5.tar.gz
tar zxvf libgd-2.2.5.tar.gz
cd libgd-2.2.5
./configure -prefix=/home/yourname/local
make
make install
make installcheck

最新更新