Error while installing Image::Magick module

PerlMagick is an object-oriented Perl interface to ImageMagick. Use this forum to discuss, make suggestions about, or report bugs concerning PerlMagick.
Post Reply
giridhar276
Posts: 1
Joined: 2013-10-18T01:40:59-07:00
Authentication code: 6789

Error while installing Image::Magick module

Post by giridhar276 »

I am trying to install Image::Magick on Strawberry Perl in windows 7... Able to create Makefile and unable to perform next further steps.

My Operation system : Windows7
Strawberry Perl is installed in(Strawberry with Padre editor) : C:\Dwimperl\perl\bin\perl.exe
Perl version : v5.14.2
Image::Magick module with version : PerlMagick 5.6.8
make type : dmake
Before this I have downloaded dll executable from website : ImageMagick-6.8.7-0-Q8-x86-dll.exe
(my windows7 is 32 bit and have opted the above exe)

Step 1:
As the first step I have installed ImageMagick-6.8.7-0-Q8-x86-dll.exe with all the options(checkboxes) like Install development headers,Add applica
tion directory etc).
After that verified the installation with convert.exe ... It worked fine.

Step2 :
Made sure that Visual C++ development enviornment is instlaled in my system.

Step 3 :
Downloaded the Image::Magick module to desktop and unzipped that and then in the command prompt typed
> perl Makefile.PL

Code: Select all

C:\Users\sripathg\Desktop\ImagaMagick related\PerlMagick-6.86\PerlMagick-6.86>pe
rl Makefile.PL
Gonna create 'libMagickCore.a' from 'C:\Program Files\ImageMagick-6.8.7-Q8\CORE_
RL_magick_.dll'
Checking if your kit is complete...
Looks good
Warning (mostly harmless): No library found for -lMagickCore-6.Q16
Generating a dmake-style Makefile
Writing Makefile for Image::Magick
Writing MYMETA.yml and MYMETA.json



Now executed the command dmake

Code: Select all

C:\Users\sripathg\Desktop\ImagaMagick related\PerlMagick-6.86\PerlMagick-6.86>dmake
dmake:  makefile:  line 450:  Warning: -- Macro `BOOTSTRAP' redefined after use
cp Magick.pm blib\lib\Image\Magick.pm
AutoSplitting blib\lib\Image\Magick.pm (blib\lib\auto\Image\Magick)
C:\Dwimperl\perl\bin\perl.exe C:\Dwimperl\perl\site\lib\ExtUtils\xsubpp  -typema
p C:\Dwimperl\perl\lib\ExtUtils\typemap -typemap typemap  Magick.xs > Magick.xsc
 && C:\Dwimperl\perl\bin\perl.exe -MExtUtils::Command -e mv -- Magick.xsc Magick
.c
gcc -c  -I"C:\Program Files\ImageMagick-6.8.7-Q8\include"       -s -O2 -DWIN32
-DPERL_TEXTMODE_SCRIPTS -DUSE_SITECUSTOMIZE -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLI
CIT_SYS -fno-strict-aliasing -mms-bitfields -s -O2        -DVERSION=\"6.86\"
-DXS_VERSION=\"6.86\"  "-IC:\Dwimperl\perl\lib\CORE"  -D_LARGE_FILES=1 -DHAVE_CO
NFIG_H Magick.c
Magick.o:Magick.c:(.text+0x31711): undefined reference to `_imp__FormatLocaleStr
ing'
Magick.o:Magick.c:(.text+0x3173d): undefined reference to `_imp__DestroyExceptio
nInfo'
Magick.o:Magick.c:(.text+0x318ac): undefined reference to `_imp__AnimateImages'
Magick.o:Magick.c:(.text+0x318b9): undefined reference to `_imp__CatchImageExcep
tion'
Magick.o:Magick.c:(.text+0x318cf): undefined reference to `_imp__InheritExceptio
n'
Magick.o:Magick.c:(.text+0x3195d): undefined reference to `_imp__ThrowMagickExce
ption'
collect2: ld returned 1 exit status
dmake:  Error code 129, while making 'blib\arch\auto\Image\Magick\Magick.dll'

The above are the exact steps that I followed....

Could anyone please let me know what went wrong.... and where I made the mistake ?

I'm struggling a lot since last four days completely to install this module but no luck....


And after browsing for the cause of this error... Some where in the blog I learned that one time { } should be removed to ARGV in makefile.
but still no luck.
magicuser
Posts: 1
Joined: 2013-10-19T02:24:28-07:00
Authentication code: 6789

Re: Error while installing Image::Magick module

Post by magicuser »

I have the same Problem:
Windows 7 64-bit
strawberry-perl-5.18.1.1-32bit
ImageMagick-6.8.7-0-Q16-x86-dll

Code: Select all

CPAN: CPAN::SQLite loaded ok (v0.203)
Database was generated on Sun, 13 Oct 2013 10:57:05 GMT

Running install for module 'Image::Magick'
Running make for J/JC/JCRISTY/PerlMagick-6.86.tar.gz
CPAN: Digest::SHA loaded ok (v5.85)
CPAN: Compress::Zlib loaded ok (v2.061)
Checksum for C:\strawberry\cpan\sources\authors\id\J\JC\JCRISTY\PerlMagick-6.86.tar.gz ok
CPAN: Archive::Tar loaded ok (v1.92)
CPAN: File::Temp loaded ok (v0.2301)
CPAN: CPAN::Meta loaded ok (v2.132140)

  CPAN.pm: Building J/JC/JCRISTY/PerlMagick-6.86.tar.gz

Gonna create 'libMagickCore.a' from 'C:\Program Files (x86)\ImageMagick-6.8.7-Q16\CORE_RL_magick_.dll'
Checking if your kit is complete...
Looks good
Warning (mostly harmless): No library found for -lMagickCore-6.Q16
Writing Makefile for Image::Magick
Writing MYMETA.yml and MYMETA.json
CPAN: Module::CoreList loaded ok (v2.96)
cp Magick.pm blib\lib\Image\Magick.pm
AutoSplitting blib\lib\Image\Magick.pm (blib\lib\auto\Image\Magick)
C:\strawberry\perl\bin\perl.exe C:\strawberry\perl\lib\ExtUtils\xsubpp  -typemap C:\strawberry\perl\lib\ExtUtils\typemap -typemap typemap  Magick.xs > Magick.xsc && C:\strawberry\perl\bin\perl.exe -MExtUtils::Command -e mv -- Magick.xsc Magick.c
gcc -c  -I"C:\Program Files (x86)\ImageMagick-6.8.7-Q16\include" 	-s -O2 -DWIN32  -DPERL_TEXTMODE_SCRIPTS -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -DUSE_PERLIO -fno-strict-aliasing -mms-bitfields -s -O2 	  -DVERSION=\"6.86\" 	-DXS_VERSION=\"6.86\"  "-IC:\strawberry\perl\lib\CORE"  -D_LARGE_FILES=1 -DHAVE_CONFIG_H Magick.c
Running Mkbootstrap for Image::Magick ()
C:\strawberry\perl\bin\perl.exe -MExtUtils::Command -e chmod -- 644 Magick.bs
C:\strawberry\perl\bin\perl.exe -MExtUtils::Mksymlists \
     -e "Mksymlists('NAME'=>\"Image::Magick\", 'DLBASE' => 'Magick', 'DL_FUNCS' => {  }, 'FUNCLIST' => [], 'IMPORTS' => {  }, 'DL_VARS' => []);"
dlltool --def Magick.def --output-exp dll.exp
g++ -o blib\arch\auto\Image\Magick\Magick.dll -Wl,--base-file -Wl,dll.base -mdll -s -L"C:\strawberry\perl\lib\CORE" -L"C:\strawberry\c\lib" -L"C:/strawberry/cpan/build/PerlMagick-6.86-trBXxD" -L"C:\Program Files \(x86\)\ImageMagick-6.8.7-Q16\lib" Magick.o   C:\strawberry\perl\lib\CORE\libperl518.a C:\strawberry\c\i686-w64-mingw32\lib\libmoldname.a C:\strawberry\c\i686-w64-mingw32\lib\libkernel32.a C:\strawberry\c\i686-w64-mingw32\lib\libuser32.a C:\strawberry\c\i686-w64-mingw32\lib\libgdi32.a C:\strawberry\c\i686-w64-mingw32\lib\libwinspool.a C:\strawberry\c\i686-w64-mingw32\lib\libcomdlg32.a C:\strawberry\c\i686-w64-mingw32\lib\libadvapi32.a C:\strawberry\c\i686-w64-mingw32\lib\libshell32.a C:\strawberry\c\i686-w64-mingw32\lib\libole32.a C:\strawberry\c\i686-w64-mingw32\lib\liboleaut32.a C:\strawberry\c\i686-w64-mingw32\lib\libnetapi32.a C:\strawberry\c\i686-w64-mingw32\lib\libuuid.a C:\strawberry\c\i686-w64-mingw32\lib\libws2_32.a C:\strawberry\c\i686-w64-mingw32\lib\libmpr.a C:\strawberry\c\i686-w64-mingw32\lib\libwinmm.a C:\strawberry\c\i686-w64-mingw32\lib\libversion.a C:\strawberry\c\i686-w64-mingw32\lib\libodbc32.a C:\strawberry\c\i686-w64-mingw32\lib\libodbccp32.a C:\strawberry\c\i686-w64-mingw32\lib\libcomctl32.a dll.exp
Magick.o:Magick.c:(.text+0x2ce): undefined reference to `_imp__ResizeQuantumMemory'
Magick.o:Magick.c:(.text+0x2e7): undefined reference to `_imp__CloneImage'
Magick.o:Magick.c:(.text+0x35c): undefined reference to `_imp__ThrowMagickException'
Magick.o:Magick.c:(.text+0x378): undefined reference to `_imp__AcquireQuantumMemory'
Magick.o:Magick.c:(.text+0x3a8): undefined reference to `_imp__InterpretLocaleValue'
Magick.o:Magick.c:(.text+0x3dd): undefined reference to `_imp__DestroyImageInfo'
Magick.o:Magick.c:(.text+0x3e8): undefined reference to `_imp__RelinquishMagickMemory'
Magick.o:Magick.c:(.text+0x474): undefined reference to `_imp__MagickToMime'
... (lots of undefined references)
Magick.o:Magick.c:(.text+0x3208a): undefined reference to `_imp__NewSplayTree'
c:/strawberry/c/bin/../lib/gcc/i686-w64-mingw32/4.7.3/../../../../i686-w64-mingw32/bin/ld.exe: Magick.o: bad reloc address 0x0 in section `.data'
c:/strawberry/c/bin/../lib/gcc/i686-w64-mingw32/4.7.3/../../../../i686-w64-mingw32/bin/ld.exe: final link failed: Invalid operation
collect2.exe: error: ld returned 1 exit status
dmake.exe:  Error code 129, while making 'blib\arch\auto\Image\Magick\Magick.dll'
  JCRISTY/PerlMagick-6.86.tar.gz
  C:\strawberry\c\bin\dmake.exe -- NOT OK
CPAN: YAML::XS loaded ok (v0.41)
Running make test
  Can't test without successful make
Running make install
  Make had returned bad status, install seems impossible
Stopping: 'install' failed for 'Image::Magick'.
awesomess3
Posts: 2
Joined: 2013-11-20T09:03:50-07:00
Authentication code: 6789

Re: Error while installing Image::Magick module

Post by awesomess3 »

I have the Solution.

I'm on Windows 8 64-bit
Using Strawberry Perl 5.18 64-bit
Installed ImageMagick 6.8.7-6-Q16 64-bit with dynamic DLLs & opted for the C++ libraries and headers.
You may have to restart the system after installing Image Magick.

1) extract PerlMagick-6.86.tar.gz
2) `cd PerlMagick-6.86/`
3) `perl Makefile.PL`
This is where you get the messages: "Gonna create 'libMagickCore.a' from 'C:\Program Files\...\CORE_RL_magick_.dll'"
and "Warning (mostly harmless): No library found for -lMagickCore-6.Q16"
4) `cp libMagickCore.a libMagickCore-6.Q16.a` #THIS IS THE SOLUTION
5) `perl Makefile.PL` #this time the "No library found" warning will disappear.
6) `dmake`
7) `dmake test`
t/write.t
t/x11/read.t
t/x11/write.t
Failed 3/25 test programs. 4/340 subtests failed.
dmake.exe: Error code 255, while making 'test_dynamic'

8) `prove -blv t/write.t`
X Windows system pixmap file (color) ...
ReadImage()
Image: XPM:input.xpm, signatures do not match.
not ok 28
Failed 1/32 subtests

9) `prove -blv t/x11/read.t`
ReadImage: Exception 420: delegate library support not built-in `The quick...' (X11) @ error/xwindow.c/XRenderImage/9865
not ok 1
X Windows system window dump file (color) ...
Readimage (input.xwd): Exception 420: no decode delegate for this image format `input.xwd' @ error/constitute.c/ReadImage/555 at t/subroutines.pl line 313
not ok 2
Failed 2/2 subtests

10) `prove -blv t/x11/write.t`
ok 1
X Windows system window dump file (color) ...
ReadImage XWD:input.xwd: Exception 420: no decode delegate for this image format `input.xwd' @ error/constitute.c/ReadImage/555
not ok 2
Failed 1/2 subtests

11) should we just `dmake install` anyways?? Or maybe we should just put this in our perl scripts:
`convert hello.jpg hello.png` :))))
Last edited by awesomess3 on 2013-11-20T10:17:22-07:00, edited 1 time in total.
awesomess3
Posts: 2
Joined: 2013-11-20T09:03:50-07:00
Authentication code: 6789

Re: Error while installing Image::Magick module

Post by awesomess3 »

The test errors have been reported as a bug for PerlMagick:
https://rt.cpan.org/Public/Bug/Display.html?id=90556
visitor x
Posts: 16
Joined: 2013-07-27T13:26:38-07:00
Authentication code: 6789

Re: Error while installing Image::Magick module

Post by visitor x »

awesomess3 wrote:The test errors have been reported as a bug for PerlMagick:
https://rt.cpan.org/Public/Bug/Display.html?id=90556
Check the other bugs for this module on rt.cpan.org. They have all been ignored. Somebody in the Perl community needs to step in to help as a maintainer.
Jairus
Posts: 1
Joined: 2014-03-11T23:12:25-07:00
Authentication code: 6789

Re: Error while installing Image::Magick module

Post by Jairus »

Thanks folks :D . I've just re-implemented awesomess3's trick on my Windows 7 32bit install, working in this directory ImageMagick-6.8.9\PerlMagick, which I downloaded (and unzipped) from http://imagemagick.com/script/download.php. dmake test reported these errors:
t/x11/read.t (Wstat: 0 Tests: 2 Failed: 2)
Failed tests: 1-2
t/x11/write.t (Wstat: 0 Tests: 2 Failed: 1)
Failed test: 2
Files=24, Tests=337, 62 wallclock secs ( 1.26 usr + 0.28 sys = 1.54 CPU)
Result: FAIL
Failed 2/24 test programs. 3/337 subtests failed.
dmake: Error code 255, while making 'test_dynamic'
I can't discover what they signify :? , but PerlMagick seems to be working fine in my script (https://github.com/harriott/jpgMagick). :)
Post Reply