ภาพ::Magick บน Strawberry Perl 5.12

ฉันกำลังพยายามติดตั้ง Image::Magick บน Strawberry Perl 5.12 บน Windows XP แต่ไม่พบ ImageMagick โมดูลเมื่อสร้าง makefile make ยังมีข้อผิดพลาดของคอมไพเลอร์มากมาย

ฉันทำสิ่งที่เขียนไว้ใน readme ของ 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 และอยู่ในตัวแปรเส้นทาง

ฉันจะทำให้สิ่งนี้ทำงานได้อย่างไร


person Demnogonis    schedule 05.03.2012    source แหล่งที่มา
comment
ไลบรารีที่หายไปเหล่านี้มีลักษณะคล้ายกับ แพ็คเกจ Visual C++ Redistributable ที่กล่าวถึงในขั้นตอนที่ 5 มาก โปรดยืนยันผู้เชี่ยวชาญ Win32   -  person daxim    schedule 05.03.2012
comment
มีการติดตั้งแพ็คเกจ Visual C++ Redistributable บนระบบของฉัน   -  person Demnogonis    schedule 05.03.2012
comment
หากคุณเรียกใช้ Convert.exe จากบรรทัดคำสั่ง มันจะล้มเหลวหรือไม่   -  person Alexandr Ciornii    schedule 06.03.2012
comment
ไม่ มันได้ผล Image Magick อยู่ในเส้นทาง   -  person Demnogonis    schedule 06.03.2012


คำตอบ (2)


ฉันมีวิธีแก้ปัญหา!

ปัญหาคือ Makefile.pl ค้นหาไบนารีในไดเร็กทอรีที่ไม่ถูกต้อง

  1. รับแพ็คเกจ ImageMagick ล่าสุด คลิก
  2. แตกไฟล์แล้วไปที่โฟลเดอร์ PerlMagick
  3. เปิด Makefile.pl ในโปรแกรมแก้ไข
  4. ดูบล็อก foreach แรก:

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

if ($line =~ /^Path:\s+(.*)/) {
  my ($vol,$dir,$file) = splitpath($1);
  next unless $dir;
  my $dirpath = catpath( $vol, $dir);
  my (@l,@b,@i) = ( (),(),() );

  # try to detect 'lib' dir
  push @l, catfile($dirpath,'..','lib');
  push @l, catfile($dirpath,'..','..','lib');
  push @l, catfile($dirpath,'..','..','..','lib');
  foreach (@l) { push @libdir, $_ if (-d $_) };

  # try to detect 'bin' dir
  push @b, catfile($dirpath,'..');
  push @b, catfile($dirpath,'..','bin');
  push @b, catfile($dirpath,'..','..');
  push @b, catfile($dirpath,'..','..','bin');
  push @b, catfile($dirpath,'..','..','..');
  push @b, catfile($dirpath,'..','..','..','bin');
  foreach (@b) { push @bindir, $_ if (-e "$_/convert.exe" || -e "$_/identify.exe") };

  # try to detect 'include' dir
  push @i, catfile($dirpath,'..','include');
  push @i, catfile($dirpath,'..','include','ImageMagick');
  push @i, catfile($dirpath,'..','..','include');
  push @i, catfile($dirpath,'..','..','include','ImageMagick');
  push @i, catfile($dirpath,'..','..','..','include');
  push @i, catfile($dirpath,'..','..','..','include','ImageMagick');
  foreach (@i) { push @incdir, $_ if (-e "$_/magick/MagickCore.h") };
}

}

สคริปต์รับตำแหน่งของการติดตั้ง IM จาก %PATH% และค้นหา bin, lib และโฟลเดอร์รวม มันดูได้ทุกที่ยกเว้นตำแหน่งจริง

ดังนั้นคุณเพียงแค่ต้องเพิ่มสิ่งเหล่านี้:

# 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 อย่างถูกต้อง จากนั้นเพียงพูด dmake และ dmake install แล้วคุณจะสบายดี

ฉันหวังว่ามันจะช่วยใครซักคนในบางครั้ง

person Demnogonis    schedule 07.03.2012
comment
ว้าวผู้ชาย! คุณคือฮีโร่ของฉัน! สิ่งนี้ได้ผลสำหรับฉัน ฉันรู้สึกหงุดหงิดมากจนไม่มีอะไรให้ลองอีกแล้ว.. มันได้ผลสำหรับฉันและฉันสามารถติดตั้งได้ ขอบคุณ! - person Sismetic; 13.11.2012
comment
ขณะนี้ฉันมีปัญหากับการดำเนินการทดสอบ dmake บางทีคุณอาจช่วยฉันได้ นี่คือหัวข้อ: stackoverflow.com/questions/13462775/ ฉันจะขอบคุณมันจริงๆ - person Sismetic; 20.11.2012
comment
@Demnogonis ตอนนี้การแก้ไขของคุณรวมอยู่ใน PerlMagick-6.89\Makefile.PL แล้ว แต่ในกรณีของฉันบน Windows 10 ฉันได้รับ fatal error: magick/MagickCore.h: No such file or directory... - person joharr; 10.04.2018

คุณอาจลองใช้วิธีที่เจ็บปวดน้อยกว่า - ตัวจัดการแพ็คเกจ Perl ที่มาพร้อมกับ Strawberry Perl

เริ่มต้นด้วยคำสั่ง "ppm" จากนั้นพิมพ์ "ติดตั้ง Image-Magick" 30 วินาทีและคุณทำเสร็จแล้ว

person Sly    schedule 29.11.2013
comment
Strawberry Perl มาพร้อมกับ ppm ของตัวเอง และทำงานได้ดียิ่งขึ้น ฉันเพิ่งย้ายจาก ActivePerl เนื่องจากพวกเขาต้องการเงินมากขึ้นเรื่อยๆ เพื่อใช้เวอร์ชัน Perl ฉันอยู่กับพวกเขาหลายครั้งเมื่อไม่มีทางเลือกอื่นสำหรับ Perl สำหรับ Windows ยกเว้นคนบ้าคลั่งที่รวบรวมทุกอย่างจากแหล่งที่มาด้วย Visual Studio :) แต่ตอนนี้พวกเขาโลภเกินไปและฉันพบทางเลือกที่ยอดเยี่ยมนี้ ขาดเพียงดีบักเกอร์ GUI แต่ ActivePerl PDK ทำงานร่วมกับ Strawberry Perl ได้ดี - person Sly; 01.12.2013
comment
ขอบคุณสำหรับการชี้แจง โดยหลักการแล้วดูเหมือนว่าจะได้ผล ขออภัย Image-Magick ไม่สามารถใช้งานได้กับ Strawberry เวอร์ชันล่าสุด ดังนั้นบางครั้งยังจำเป็นต้องใช้ CPAN.pm แทน - person Slaven Rezic; 01.12.2013
comment
ppm ไม่ทำสิ่งเดียวกันกับ cpan ใช่ไหม ดาวน์โหลดแพ็คเกจจาก repo และรัน buggy makefile.pl? ฉันไม่เคยใช้ ActivePerl ดังนั้นจึงไม่มีความรู้เกี่ยวกับวิธีการทำงานภายในของ ppm - person Demnogonis; 05.12.2013
comment
ไม่ ppm ติดตั้งไบนารีที่คอมไพล์แล้ว ไม่จำเป็นต้องใช้คอมไพเลอร์และไม่ต้องรอ มันจะเกิดขึ้นภายในไม่กี่วินาที - หากมีเวอร์ชันโมดูลที่คอมไพล์ไว้แล้ว - person Sly; 05.12.2013
comment
สิ่งนี้ดูเหมือนจะใช้ได้กับ Windows 10, version 1709 ของฉันด้วย ImageMagick 7.0.7-28 Q16 (64-bit) > Install development headers and libraries for C and C++ แต่จากนั้นก็ค้นพบว่าไม่สามารถ Read ใน jpegs ... - person joharr; 10.04.2018