Setup:
- Windows 7 professional 64bit
- Strawberry Perl 5.14.2 64bit (perl -v output: This is perl 5, version 14, subversion 2 (v5.14.2) built for MSWin32-x64-multi-thread)
- ImageMagick: ImageMagick-6.7.7-8-Q16-windows-x64-dll.exe 64bit dynamic with libraries and header files installed.
When trying to install PerlMagick using cpan, I was getting:
Code: Select all
################################### 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.
...
So Makefile.PL could not find my installation of ImageMagick. Turns out if was not looking in the right place. Go to the cpan build directory, C:\strawberry\cpan\build\PerlMagick-6.77-xyzxyz (replace C:\strawberry with your own location if your strawberry perl is installed elsewhere and note that "xyzxyz" will be a random character sequence). Open Makefile.PL and add the following 3 lines after line 47:
Code: Select all
push @l, catfile($dirpath, 'lib');
push @b, $dirpath;
push @i, catfile($dirpath, 'include');
Code: Select all
47: # try to detect 'lib' dir
48: push @l, catfile($dirpath, 'lib');
49: push @b, $dirpath;
50: push @i, catfile($dirpath, 'include');
Code: Select all
Gonna create 'libMagickCore.a' from 'C:\Program Files\ImageMagick-6.7.7-Q16\CORE_RL_magick_.dll'
Writing Makefile for Image::Magick
Writing MYMETA.yml and MYMETA.json
Code: Select all
pm_to_blib : $(FIRST_MAKEFILE) $(TO_INST_PM)
$(NOECHO) $(ABSPERLRUN) -MExtUtils::Install -e "pm_to_blib({{@ARGV}}, '$(INST_LIB)\auto', q[$(PM_FILTER)], '$(PERM_DIR)')" -- \
Magick.pm $(INST_LIB)\Image\Magick.pm
$(NOECHO) $(TOUCH) pm_to_blib
Code: Select all
$(NOECHO) $(ABSPERLRUN) -MExtUtils::Install -e "pm_to_blib({@ARGV}, '$(INST_LIB)\auto', q[$(PM_FILTER)], '$(PERM_DIR)')" -- \
Go back to around line 248 that looks like this:
Code: Select all
MOD_INSTALL = $(ABSPERLRUN) -MExtUtils::Install -e "install([ from_to => {{@ARGV}}, verbose => '$(VERBINST)', uninstall_shadows => '$(UNINST)', dir_mode => '$(PERM_DIR)' ]);" --
Save the file and go back to the command prompt.
Run "gmake". You should see some output, but no errors, ending with
Code: Select all
C:\strawberry\perl\bin\perl.exe -MExtUtils::Command -e cp -- Magick.bs blib\arch\auto\Image\Magick\Magick.bs
C:\strawberry\perl\bin\perl.exe -MExtUtils::Command -e chmod -- 644 blib\arch\auto\Image\Magick\Magick.bs
Code: Select all
{Appending installation info to C:\strawberry\perl\lib/perllocal.pod}
Code: Select all
C:\strawberry\cpan\build\PerlMagick-6.77-wFH2IH>perl -MImage::Magick -e 1
C:\strawberry\cpan\build\PerlMagick-6.77-wFH2IH>
Alex