gpt4 book ai didi

perl - 图片::草莓 Perl 5.12 上的 Magick

转载 作者:行者123 更新时间:2023-12-01 14:59:34 24 4
gpt4 key购买 nike

我正在尝试在 Strawberry Perl 上安装 Image::Magick 5.12 在 Windows XP 上,但找不到 ImageMagick生成 makefile 时的模块。 make 还会抛出很多编译器错误。

我完全按照 Image::Magic 的自述文件中的内容进行了操作:

Installation - Win32 Strawberry perl

On Win32 Strawberry Perl the preferred way of installing PerlMagick is the
following:

1) Download and install ImageMagick Windows binaries from
http://www.imagemagick.org/script/binary-releases.php#windows

2) You HAVE TO choose dynamic (DLL) ImageMagick binaries. Note: it is not
possible to mix 32/64bit binaries of Perl and ImageMagick

3) During installation select that you want to install ImageMagick's
development files (libraries+headers)

4) You NEED TO have ImageMagick's directory in your PATH. Note: we are
checking the presence of convert.exe or identify.exe tools

5) You might need Visual C++ Redistributable Package installed on your
system. See instructions on ImageMagick's Binary Release webpage.

6) If you have all prerequisites 1)...5) you can simply install
ImageMagick by running: cpan -i Image::Magick

我得到这个:

################################### WARNING! ###################################
# It seems that you are trying to install Perl::Magick on a MS Windows box with
# perl + gcc compiler (e.g. Strawberry Perl), however we cannot find ImageMagick
# binaries installed on your system.
#
# Please check the following prerequisites:
#
# 1) You need to have installed ImageMagick Windows binaries from
# http://www.imagemagick.org/script/binary-releases.php#windows
#
# 2) We only support dynamic (DLL) ImageMagick binaries
# note: it is not possible to mix 32/64-bit binaries of perl and ImageMagick
#
# 3) During installation select that you want to install ImageMagick's
# development files (libraries+headers)
#
# 4) You also need to have ImageMagick's directory in your PATH
# note: we are checking the presence of convert.exe and/or identify.exe tools
#
# 5) You might need Visual C++ Redistributable Package installed on your system
# see instructions on ImageMagick's Binary Release webpage
#
# We are gonna continue, but chances for successful build are very low!
################################################################################
Note (probably harmless): No library found for -lMagickCore
Note (probably harmless): No library found for -lmoldname
Note (probably harmless): No library found for -lkernel32
Note (probably harmless): No library found for -luser32
Note (probably harmless): No library found for -lgdi32
Note (probably harmless): No library found for -lwinspool
Note (probably harmless): No library found for -lcomdlg32
Note (probably harmless): No library found for -ladvapi32
Note (probably harmless): No library found for -lshell32
Note (probably harmless): No library found for -lole32
Note (probably harmless): No library found for -loleaut32
Note (probably harmless): No library found for -lnetapi32
Note (probably harmless): No library found for -luuid
Note (probably harmless): No library found for -lws2_32
Note (probably harmless): No library found for -lmpr
Note (probably harmless): No library found for -lwinmm
Note (probably harmless): No library found for -lversion
Note (probably harmless): No library found for -lodbc32
Note (probably harmless): No library found for -lodbccp32
Note (probably harmless): No library found for -lcomctl32
Writing Makefile for Image::Magick
Writing MYMETA.yml and MYMETA.json

但 ImageMagick 二进制文件已安装并位于路径变量中。

我如何让它运行?

最佳答案

我有一个解决方案!

问题是,Makefile.pl 在错误的目录中查找二进制文件。

  1. 获取最新的 ImageMagick 包。 click
  2. 解压缩并导航到 PerlMagick 文件夹
  3. 在编辑器中打开 Makefile.pl
  4. 看看第一个 foreach block :


foreach 我的 $line (split '\n', $conf) {



if ($line =~/^Path:\s+(.*)/) {
我的 ($vol,$dir,$file) = splitpath($1);
下一步,除非 $dir;
我的 $dirpath = catpath( $vol, $dir);
我的 (@l,@b,@i) = ( (),(),());

# 尝试检测“lib”目录
推@l, catfile($dirpath,'..','lib');
推@l, catfile($dirpath,'..','..','lib');
推@l, catfile($dirpath,'..','..','..','lib');
foreach (@l) { push @libdir, $_ if (-d $_) };

# 尝试检测“bin”目录
推@b, catfile($dirpath,'..');
推 @b, catfile($dirpath,'..','bin');
推@b, catfile($dirpath,'..','..');
推 @b, catfile($dirpath,'..','..','bin');
推 @b, catfile($dirpath,'..','..','..');
推 @b, catfile($dirpath,'..','..','..','bin');
foreach (@b) { push @bindir, $_ if (-e "$_/convert.exe"|| -e "$_/identify.exe") };

# 尝试检测“include”目录
推送@i,catfile($dirpath,'..','include');
推送@i,catfile($dirpath,'..','include','ImageMagick');
推送@i,catfile($dirpath,'..','..','include');
推送@i,catfile($dirpath,'..','..','include','ImageMagick');
推送@i,catfile($dirpath,'..','..','..','include');
推送@i,catfile($dirpath,'..','..','..','include','ImageMagick');
foreach (@i) { push @incdir, $_ if (-e "$_/magick/MagickCore.h") };
}

}

脚本从 %PATH% 获取 IM 安装的位置,并查找 bin、lib 和 include 文件夹。它看起来无处不在,除了它的实际位置。

所以你只需要添加这些:

# try to detect 'lib' dir
push @l, catfile($dirpath,'lib');
...
# try to detect 'bin' dir
push @b, catfile($dirpath);
...
# try to detect 'include' dir
push @i, catfile($dirpath,'include');
...

之后您可以执行perl Makefile.pl,它会正确生成makefile。然后只需说 dmakedmake install 就可以了。

我希望这对某些人有所帮助。

关于perl - 图片::草莓 Perl 5.12 上的 Magick,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9567568/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com