我试图通过运行GD::多边形来安装cpan install GD::Polygon,但是我得到了以下错误:
**UNRECOVERABLE ERROR**
Could not find gdlib-config in the search path. Please install libgd
2.0.28 or higher.我从源代码(./configure、make、make install)手动安装了libgd-2.2.1,现在当我运行whereis gdlib-config时,我看到它确实安装了:
gdlib-config: /usr/local/bin/gdlib-config我如何告诉cpan在哪里可以找到这个库?
发布于 2016-06-21 16:02:06
简单的回答是:我通过yum而不是cpan安装了GD。
sudo yum install perl-GD如果您仍然希望通过cpan安装它,您应该在您的路径中包括gdlib-config (而不仅仅是文件夹,例如/usr/local/bin或它所在的任何地方)。
用yum安装Perl包肯定比用cpan好
发布于 2017-04-28 15:15:52
我同意使用包管理器。您没有提到您使用的操作系统。在Ubuntu上,/usr/local/bin也位于根用户的路径中。您可以反复检查该文件是否可执行。
还要确保执行Perl编译的脚本不会搞乱PATH变量。
我使用perlbrew,不作为root运行,使用cpan来安装东西。注意:在Ubuntu 16.10和17.04 gdlib-config中丢失了,因为debian维护人员似乎已经删除了它。
要获得它,您可以在这里编译源代码: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;干杯
发布于 2017-11-18 16:11:14
顺便说一句,CPAN安装程序似乎只需要一个libgd的"devel“版本来构建包。我试着把它安装在一个老的cygwin平台上,最后它与“libgd”组件一起工作。
https://stackoverflow.com/questions/37947772
复制相似问题