in reply to Errors While Installing Image::Magick

I've been routinely building and installing Image::Magick on the monthly perl devel releases using ImageMagick-7.1.1-19-Q16-HDRI-x64-dll.exe, which I obtained from the ImageMagick website.
The current version is ImageMagick-7.1.1-28-Q16-HDRI-x64-dll.exe, and I suggest you try it.
Having downloaded that file (the "19" version), I executed it, and directed its stuff into C:\d\ImageMagick-7.1.1-Q16-HDRI.
I then simply insert C:\d\ImageMagick-7.1.1-Q16-HDRI at the beginning of the path, and install Image::Magick by running cpan -i ImageMagick.
Then I have:
> perl -MImage::Magick -le "print $Image::Magick::VERSION;" 7.1.1
I suggest you try that same approach, using the "28" version of the executable.
If you have trouble with that, let us know - and I'll grab the same source and try to figure out what has gone wrong.
UPDATE: That all looks a bit too simple ... I wonder if I've missed something ... anyway, see how you go.

Cheers,
Rob

Replies are listed 'Best First'.
Re^2: Errors While Installing Image::Magick
by roho (Bishop) on Feb 15, 2024 at 08:47 UTC
    Thanks syphilis, but that is essentially what I did originally, only I used the default Image Magic install path (C:\Program Files\ImageMagick-7.1.1-Q16-HDRI), and the Image Magic install program put the pathname at the top of my system path. Is there something special about using a different install path (C:\d\ImageMagick...) rather than the default installation path?

    "It's not how hard you work, it's how much you get done."

      Your problem seems to be associated with the need for a C++ compiler.
      I don't hit that problem ... but then I'm on a modern perl, using (a modern) gcc-13.1.0.
      But I wonder if there's a compiler switch (maybe -std=c++11) that would fix that for you.
      I'm pretty sure you can modify $Config{{ccflags} by hand-editing the "ccflags" entries in lib/Config.pm and lib/Config_heavy.pl, if you want to give that a try.

      Below is what I just got (minus some compilation warnings).
      Not sure why one test failed ... that doesn't normally happen, AFAIK.

      Cheers,
      Rob
      Configuring J/JC/JCRISTY/Image-Magick-7.1.1-28.tar.gz with Makefile.PL Gonna create 'libMagickCore.a' from 'C:\d\ImageMagick-7.1.1-Q16-HDRI\C +ORE_RL_MagickCore_.dll' Checking if your kit is complete... Looks good Generating a gmake-style Makefile Writing Makefile for Image::Magick Writing MYMETA.yml and MYMETA.json JCRISTY/Image-Magick-7.1.1-28.tar.gz D:\perl-5.39.7-1320-ucrt-mcf\bin\MSWin32-x64-multi-thread-ld\perl.ex +e Makefile.PL -- OK Running make for J/JC/JCRISTY/Image-Magick-7.1.1-28.tar.gz cp Magick.pm blib\lib\Image\Magick.pm AutoSplitting blib\lib\Image\Magick.pm (blib\lib\auto\Image\Magick) Running Mkbootstrap for Magick () "D:\perl-5.39.7-1320-ucrt-mcf\bin\MSWin32-x64-multi-thread-ld\perl.exe +" -MExtUtils::Command -e chmod -- 644 "Magick.bs" "D:\perl-5.39.7-1320-ucrt-mcf\bin\MSWin32-x64-multi-thread-ld\perl.exe +" -MExtUtils::Command::MM -e cp_nonempty -- Magick.bs blib\arch\auto\ +Image\Magick\Magick.bs 644 "D:\perl-5.39.7-1320-ucrt-mcf\bin\MSWin32-x64-multi-thread-ld\perl.exe +" "D:\perl-5.39.7-1320-ucrt-mcf\lib\ExtUtils/xsubpp" -typemap D:\per +l-5.39.7-1320-ucrt-mcf\lib\ExtUtils\typemap -typemap C:\Users\Owner\. +cpan\build\Image-Magick-7.1.1-16\typemap Magick.xs > Magick.xsc "D:\perl-5.39.7-1320-ucrt-mcf\bin\MSWin32-x64-multi-thread-ld\perl.exe +" -MExtUtils::Command -e mv -- Magick.xsc Magick.c gcc -c -I"C:\d\ImageMagick-7.1.1-Q16-HDRI\include" -Wall -Wextra -Wer +ror=pointer-arith -Wno-format -Wno-long-long -Werror=vla -std=c99 -DW +IN32 -DWIN64 -fdiagnostics-color=never -DPERL_TEXTMODE_SCRIPTS -DMULT +IPLICITY -DPERL_IMPLICIT_SYS -DUSE_PERLIO -D__USE_MINGW_ANSI_STDIO -f +wrapv -fno-strict-aliasing -mms-bitfields -Os -DVERSION=\"7.1.1\" - +DXS_VERSION=\"7.1.1\" "-ID:\perl-5.39.7-1320-ucrt-mcf\lib\MSWin32-x6 +4-multi-thread-ld\CORE" -D_LARGE_FILES=1 -DHAVE_CONFIG_H Magick.c [ snipped some compilation warnings for brevity ] "D:\perl-5.39.7-1320-ucrt-mcf\bin\MSWin32-x64-multi-thread-ld\perl.exe +" -MExtUtils::Mksymlists \ -e "Mksymlists('NAME'=>\"Image::Magick\", 'DLBASE' => 'Magick', ' +DL_FUNCS' => { }, 'FUNCLIST' => [], 'IMPORTS' => { }, 'DL_VARS' => +[]);" g++ Magick.def -o blib\arch\auto\Image\Magick\Magick.dll -shared -s -L +"D:\perl-5.39.7-1320-ucrt-mcf\lib\MSWin32-x64-multi-thread-ld\CORE" - +L"C:\winlibs-ucrt-1320\mingw64\lib" -L"C:\winlibs-ucrt-1320\mingw64\x +86_64-w64-mingw32\lib" -L"C:\winlibs-ucrt-1320\mingw64\lib\gcc\x86_64 +-w64-mingw32\13.2.0" -L"C:/Users/Owner/.cpan/build/Image-Magick-7.1.1 +-16" -L"C:\d\ImageMagick-7.1.1-Q16-HDRI\lib" Magick.o "D:\perl-5.3 +9.7-1320-ucrt-mcf\lib\MSWin32-x64-multi-thread-ld\CORE\libperl539.a" +"libMagickCore.a" "C:\winlibs-ucrt-1320\mingw64\x86_64-w64-mingw32\li +b\libmoldname.a" "C:\winlibs-ucrt-1320\mingw64\x86_64-w64-mingw32\lib +\libkernel32.a" "C:\winlibs-ucrt-1320\mingw64\x86_64-w64-mingw32\lib\ +libuser32.a" "C:\winlibs-ucrt-1320\mingw64\x86_64-w64-mingw32\lib\lib +gdi32.a" "C:\winlibs-ucrt-1320\mingw64\x86_64-w64-mingw32\lib\libwins +pool.a" "C:\winlibs-ucrt-1320\mingw64\x86_64-w64-mingw32\lib\libcomdl +g32.a" "C:\winlibs-ucrt-1320\mingw64\x86_64-w64-mingw32\lib\libadvapi +32.a" "C:\winlibs-ucrt-1320\mingw64\x86_64-w64-mingw32\lib\libshell32 +.a" "C:\winlibs-ucrt-1320\mingw64\x86_64-w64-mingw32\lib\libole32.a" +"C:\winlibs-ucrt-1320\mingw64\x86_64-w64-mingw32\lib\liboleaut32.a" " +C:\winlibs-ucrt-1320\mingw64\x86_64-w64-mingw32\lib\libnetapi32.a" "C +:\winlibs-ucrt-1320\mingw64\x86_64-w64-mingw32\lib\libuuid.a" "C:\win +libs-ucrt-1320\mingw64\x86_64-w64-mingw32\lib\libws2_32.a" "C:\winlib +s-ucrt-1320\mingw64\x86_64-w64-mingw32\lib\libmpr.a" "C:\winlibs-ucrt +-1320\mingw64\x86_64-w64-mingw32\lib\libwinmm.a" "C:\winlibs-ucrt-132 +0\mingw64\x86_64-w64-mingw32\lib\libversion.a" "C:\winlibs-ucrt-1320\ +mingw64\x86_64-w64-mingw32\lib\libodbc32.a" "C:\winlibs-ucrt-1320\min +gw64\x86_64-w64-mingw32\lib\libodbccp32.a" "C:\winlibs-ucrt-1320\ming +w64\x86_64-w64-mingw32\lib\libcomctl32.a" -Wl,--enable-auto-image-bas +e "D:\perl-5.39.7-1320-ucrt-mcf\bin\MSWin32-x64-multi-thread-ld\perl.exe +" -MExtUtils::Command -e chmod -- 755 blib\arch\auto\Image\Magick\Mag +ick.dll JCRISTY/Image-Magick-7.1.1-28.tar.gz C:\make\bin\make.EXE -- OK The current configuration of allow_installing_outdated_dists is 'ask/n +o', but for this option we would need 'CPAN::DistnameInfo' installed. + Please install 'CPAN::DistnameInfo' as soon as possible. As long as +we are not equipped with 'CPAN::DistnameInfo' this option does not ta +ke effect Running make test for JCRISTY/Image-Magick-7.1.1-28.tar.gz "D:\perl-5.39.7-1320-ucrt-mcf\bin\MSWin32-x64-multi-thread-ld\perl.exe +" -MExtUtils::Command::MM -e cp_nonempty -- Magick.bs blib\arch\auto\ +Image\Magick\Magick.bs 644 "D:\perl-5.39.7-1320-ucrt-mcf\bin\MSWin32-x64-multi-thread-ld\perl.exe +" "-MExtUtils::Command::MM" "-MTest::Harness" "-e" "undef *Test::Harn +ess::Switches; test_harness(0, 'blib\lib', 'blib\arch')" t/*.t t/blob.t .......... ok t/composite.t ..... ok t/filter.t ........ Failed 1/58 subtests t/getattribute.t .. ok t/montage.t ....... ok t/ping.t .......... ok t/read.t .......... ok t/setattribute.t .. ok t/write.t ......... ok Test Summary Report ------------------- t/filter.t (Wstat: 0 Tests: 58 Failed: 1) Failed test: 2 Files=9, Tests=273, 2 wallclock secs ( 0.03 usr + 0.00 sys = 0.03 C +PU) Result: FAIL Failed 1/9 test programs. 1/273 subtests failed. make.EXE: *** [makefile:1047: test_dynamic] Error 255 JCRISTY/Image-Magick-7.1.1-28.tar.gz C:\make\bin\make.EXE test -- NOT OK //hint// to see the cpan-testers results for installing this module, t +ry: reports JCRISTY/Image-Magick-7.1.1-28.tar.gz Running make install for JCRISTY/Image-Magick-7.1.1-28.tar.gz "D:\perl-5.39.7-1320-ucrt-mcf\bin\MSWin32-x64-multi-thread-ld\perl.exe +" -MExtUtils::Command::MM -e cp_nonempty -- Magick.bs blib\arch\auto\ +Image\Magick\Magick.bs 644 Files found in blib\arch: installing files in blib\lib into architectu +re dependent library tree Installing D:\perl-5.39.7-1320-ucrt-mcf\site\lib\MSWin32-x64-multi-thr +ead-ld\auto\Image\Magick\Magick.dll Appending installation info to D:\perl-5.39.7-1320-ucrt-mcf\lib\MSWin3 +2-x64-multi-thread-ld/perllocal.pod JCRISTY/Image-Magick-7.1.1-28.tar.gz C:\make\bin\make.EXE install -- OK
        But I wonder if there's a compiler switch (maybe -std=c++11) that would fix that for you.

        Not that I can find.
        Having upgraded the ImageMagick executable from release 19 to release 28, I hit the same issue.
        To fix, I did a cd to the .cpan build directory and started by removing the failed cpan -fi Image::Magick attempt:
        C:\> cd \Users\Owner\.cpan\build\Image-Magick-7.1.1-18 then C:\Users\Owner\.cpan\build\Image-Magick-7.1.1-18>gmake realclean then C:\Users\Owner\.cpan\build\Image-Magick-7.1.1-18>perl Makefile.PL CC=g +++ then C:\Users\Owner\.cpan\build\Image-Magick-7.1.1-18>gmake test then C:\Users\Owner\.cpan\build\Image-Magick-7.1.1-18>gmake install
        That worked fine for me, though the single test still failed:
        t/blob.t .......... ok t/composite.t ..... ok t/filter.t ........ Failed 1/58 subtests t/getattribute.t .. ok t/montage.t ....... ok t/ping.t .......... ok t/read.t .......... ok t/setattribute.t .. ok t/write.t ......... ok Test Summary Report ------------------- t/filter.t (Wstat: 0 Tests: 58 Failed: 1) Failed test: 2 Files=9, Tests=273, 1 wallclock secs ( 0.01 usr + 0.00 sys = 0.01 C +PU) Result: FAIL Failed 1/9 test programs. 1/273 subtests failed. gmake: *** [makefile:1048: test_dynamic] Error 255
        Update: Looks like that one test fails for me because the font "Generic.ttf" can't be found:
        Annotate(text=>'Magick',geometry=>'+0+20',font=>'Generic.ttf',fill=>'g +old',gravity=>'North',pointsize=>14) ... Annotate (text=>'Magick',geometry=>'+0+20',font=>'Generic.ttf',fill= +>'gold',gravity=>'North',pointsize=>14): Exception 305: unable to read font `Generic.ttf' @ warning/annotate. +c/RenderType/1024 not ok 2
        Update 2: In the previous versions of Image::Magick that I've built, "Generic.tiff" has been provided in both the "demo" and the "t" folders - though the MANIFEST file listed only "demo/Generic.tiff"..
        Now, however, "Generic.tiff" is to be found only in the "demo" folder.
        Copying "demo/Generic.tiff" to "t/Generic.tiff" allows all tests to pass.

        Cheers,
        Rob