Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer

Installing Imager::QRCode on windows 8

by shohn (Novice)
on Nov 13, 2013 at 15:58 UTC ( #1062405=perlquestion: print w/replies, xml ) Need Help??
shohn has asked for the wisdom of the Perl Monks concerning the following question:

Hi, I've tried installing Imager::QRCode on windows 8 running strawberry perl but I just can't get it to install. I ran:

cpanm Imager::QRCode

from the command line, and I get complition errors. The log file tells me the following:

cpanm (App::cpanminus) 1.7001 on perl 5.018001 built for MSWin32-x64-m +ulti-thread Work directory is C:\Users\DAVEMC~1/.cpanm/work/1384355419.2060 You have make C:\strawberry\c\bin\dmake.exe You have LWP 6.05 Falling back to Archive::Tar 1.92 Searching Imager::QRCode on cpanmetadb ... --> Working on Imager::QRCode Fetching +034.tar.gz -> OK Unpacking Imager-QRCode-0.034.tar.gz Entering Imager-QRCode-0.034 Checking configure dependencies from META.yml Checking if you have ExtUtils::ParseXS 2.21 ... Yes (3.21) Checking if you have ExtUtils::MakeMaker 6.36 ... Yes (6.72) Checking if you have Imager 0.55 ... Yes (0.97) Configuring Imager-QRCode-0.034 Running Makefile.PL Cannot determine perl version info from lib/Imager/ *** Module::AutoInstall version 1.06 *** Checking for Perl dependencies... *** Since we're running under cpanminus, I'll just let it take care of the dependency's installation later. [Core Features] - Imager ...loaded. (0.97 >= 0.55) - Test::More ...loaded. (0.98) - XSLoader ...loaded. (0.16 >= 0.02) *** Module::AutoInstall configuration finished. Checking if your kit is complete... Looks good Writing Makefile for Imager::QRCode Writing MYMETA.yml and MYMETA.json -> OK Checking dependencies from MYMETA.json ... Checking if you have Test::More 0 ... Yes (0.98) Checking if you have ExtUtils::ParseXS 2.21 ... Yes (3.21) Checking if you have XSLoader 0.02 ... Yes (0.16) Checking if you have ExtUtils::MakeMaker 6.36 ... Yes (6.72) Checking if you have Imager 0.55 ... Yes (0.97) Building and testing Imager-QRCode-0.034 cp lib/Imager/ blib\lib\Imager\ gcc -c -Isrc "-I." -IC:/strawberry/perl/vendor/lib/Imager/include + -s -O2 -DWIN32 -DWIN64 -DCONSERVATIVE -DPERL_TEXTMODE_SCRIPTS -DPERL +_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -DUSE_PERLIO -fno-strict-aliasi +ng -mms-bitfields -DOVER_LIBQRENCODE_2_0_0 -DHAVE_CONFIG_H -s -O2 + -DVERSION=\"0.034\" -DXS_VERSION=\"0.034\" -o src\bitstream.o + "-IC:\strawberry\perl\lib\CORE" src\bitstream.c gcc -c -Isrc "-I." -IC:/strawberry/perl/vendor/lib/Imager/include + -s -O2 -DWIN32 -DWIN64 -DCONSERVATIVE -DPERL_TEXTMODE_SCRIPTS -DPERL +_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -DUSE_PERLIO -fno-strict-aliasi +ng -mms-bitfields -DOVER_LIBQRENCODE_2_0_0 -DHAVE_CONFIG_H -s -O2 + -DVERSION=\"0.034\" -DXS_VERSION=\"0.034\" -o src\mask.o "-IC +:\strawberry\perl\lib\CORE" src\mask.c gcc -c -Isrc "-I." -IC:/strawberry/perl/vendor/lib/Imager/include + -s -O2 -DWIN32 -DWIN64 -DCONSERVATIVE -DPERL_TEXTMODE_SCRIPTS -DPERL +_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -DUSE_PERLIO -fno-strict-aliasi +ng -mms-bitfields -DOVER_LIBQRENCODE_2_0_0 -DHAVE_CONFIG_H -s -O2 + -DVERSION=\"0.034\" -DXS_VERSION=\"0.034\" -o src\mmask.o "-I +C:\strawberry\perl\lib\CORE" src\mmask.c gcc -c -Isrc "-I." -IC:/strawberry/perl/vendor/lib/Imager/include + -s -O2 -DWIN32 -DWIN64 -DCONSERVATIVE -DPERL_TEXTMODE_SCRIPTS -DPERL +_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -DUSE_PERLIO -fno-strict-aliasi +ng -mms-bitfields -DOVER_LIBQRENCODE_2_0_0 -DHAVE_CONFIG_H -s -O2 + -DVERSION=\"0.034\" -DXS_VERSION=\"0.034\" -o src\mqrspec.o " +-IC:\strawberry\perl\lib\CORE" src\mqrspec.c C:\strawberry\perl\bin\perl.exe "-Iinc" C:\strawberry\perl\lib\ExtUtil +s\xsubpp -typemap C:\strawberry\perl\lib\ExtUtils\typemap -typemap C +:/strawberry/perl/vendor/lib/Imager/typemap src\QRCode.xs > src\QRCo +de.xsc && C:\strawberry\perl\bin\perl.exe "-Iinc" -MExtUtils::Command + -e mv -- src\QRCode.xsc src\QRCode.c gcc -c -Isrc "-I." -IC:/strawberry/perl/vendor/lib/Imager/include + -s -O2 -DWIN32 -DWIN64 -DCONSERVATIVE -DPERL_TEXTMODE_SCRIPTS -DPERL +_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -DUSE_PERLIO -fno-strict-aliasi +ng -mms-bitfields -DOVER_LIBQRENCODE_2_0_0 -DHAVE_CONFIG_H -s -O2 + -DVERSION=\"0.034\" -DXS_VERSION=\"0.034\" -o src\QRCode.o "- +IC:\strawberry\perl\lib\CORE" src\QRCode.c gcc -c -Isrc "-I." -IC:/strawberry/perl/vendor/lib/Imager/include + -s -O2 -DWIN32 -DWIN64 -DCONSERVATIVE -DPERL_TEXTMODE_SCRIPTS -DPERL +_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -DUSE_PERLIO -fno-strict-aliasi +ng -mms-bitfields -DOVER_LIBQRENCODE_2_0_0 -DHAVE_CONFIG_H -s -O2 + -DVERSION=\"0.034\" -DXS_VERSION=\"0.034\" -o src\qrencode.o +"-IC:\strawberry\perl\lib\CORE" src\qrencode.c gcc -c -Isrc "-I." -IC:/strawberry/perl/vendor/lib/Imager/include + -s -O2 -DWIN32 -DWIN64 -DCONSERVATIVE -DPERL_TEXTMODE_SCRIPTS -DPERL +_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -DUSE_PERLIO -fno-strict-aliasi +ng -mms-bitfields -DOVER_LIBQRENCODE_2_0_0 -DHAVE_CONFIG_H -s -O2 + -DVERSION=\"0.034\" -DXS_VERSION=\"0.034\" -o src\qrinput.o " +-IC:\strawberry\perl\lib\CORE" src\qrinput.c gcc -c -Isrc "-I." -IC:/strawberry/perl/vendor/lib/Imager/include + -s -O2 -DWIN32 -DWIN64 -DCONSERVATIVE -DPERL_TEXTMODE_SCRIPTS -DPERL +_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -DUSE_PERLIO -fno-strict-aliasi +ng -mms-bitfields -DOVER_LIBQRENCODE_2_0_0 -DHAVE_CONFIG_H -s -O2 + -DVERSION=\"0.034\" -DXS_VERSION=\"0.034\" -o src\qrspec.o "- +IC:\strawberry\perl\lib\CORE" src\qrspec.c gcc -c -Isrc "-I." -IC:/strawberry/perl/vendor/lib/Imager/include + -s -O2 -DWIN32 -DWIN64 -DCONSERVATIVE -DPERL_TEXTMODE_SCRIPTS -DPERL +_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -DUSE_PERLIO -fno-strict-aliasi +ng -mms-bitfields -DOVER_LIBQRENCODE_2_0_0 -DHAVE_CONFIG_H -s -O2 + -DVERSION=\"0.034\" -DXS_VERSION=\"0.034\" -o src\rscode.o "- +IC:\strawberry\perl\lib\CORE" src\rscode.c gcc -c -Isrc "-I." -IC:/strawberry/perl/vendor/lib/Imager/include + -s -O2 -DWIN32 -DWIN64 -DCONSERVATIVE -DPERL_TEXTMODE_SCRIPTS -DPERL +_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -DUSE_PERLIO -fno-strict-aliasi +ng -mms-bitfields -DOVER_LIBQRENCODE_2_0_0 -DHAVE_CONFIG_H -s -O2 + -DVERSION=\"0.034\" -DXS_VERSION=\"0.034\" -o src\split.o "-I +C:\strawberry\perl\lib\CORE" src\split.c Running Mkbootstrap for Imager::QRCode () C:\strawberry\perl\bin\perl.exe "-Iinc" -MExtUtils::Command -e chmod - +- 644 C:\strawberry\perl\bin\perl.exe "-Iinc" -MExtUtils::Mksymlists \ -e "Mksymlists('NAME'=>\"Imager::QRCode\", 'DLBASE' => 'QRCode', +'DL_FUNCS' => { }, 'FUNCLIST' => [], 'IMPORTS' => { }, 'DL_VARS' => + []);" dlltool --def QRCode.def --output-exp dll.exp g++ -o blib\arch\auto\Imager\QRCode\QRCode.dll -Wl,--base-file -Wl,dll +.base -mdll -s -L"C:\strawberry\perl\lib\CORE" -L"C:\strawberry\c\lib +" src/bitstream.o src/mask.o src/mmask.o src/mqrspec.o + src/QRCode.o src/qrencode.o src/qrinput.o src/qrspec.o + src/rscode.o src/split.o C:\strawberry\perl\lib\CORE\libper +l518.a -lmoldname -lkernel32 -luser32 -lgdi32 -lwinspool -lcomdlg32 - +ladvapi32 -lshell32 -lole32 -loleaut32 -lnetapi32 -luuid -lws2_32 -lm +pr -lwinmm -lversion -lodbc32 -lodbccp32 -lcomctl32 dll.exp src/mqrspec.o:mqrspec.c:(.text+0x185): undefined reference to `__imp_p +thread_mutex_lock' src/mqrspec.o:mqrspec.c:(.text+0x199): undefined reference to `__imp_p +thread_mutex_unlock' src/mqrspec.o:mqrspec.c:(.text+0x32d): undefined reference to `__imp_p +thread_mutex_lock' src/mqrspec.o:mqrspec.c:(.text+0x34c): undefined reference to `__imp_p +thread_mutex_unlock' c:/strawberry/c/bin/../lib/gcc/x86_64-w64-mingw32/4.7.3/../../../../x8 +6_64-w64-mingw32/bin/ld.exe: src/mqrspec.o: bad reloc address 0x0 in +section `.pdata' c:/strawberry/c/bin/../lib/gcc/x86_64-w64-mingw32/4.7.3/../../../../x8 +6_64-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\Imager\QRCode +\QRCode.dll' -> FAIL Installing Imager::QRCode failed. See C:\Users\DAVEMC~1\.cpanm +\work\1384355419.2060\build.log for details. Retry with --force to fo +rce install it.

I retried using the --force switch but I still can't get it to install. Could anyone running windows 8 try and install that package?

Replies are listed 'Best First'.
Re: Installing Imager::QRCode on windows 8
by marto (Archbishop) on Nov 13, 2013 at 16:28 UTC

    The problem is with linking, forcing won't make a difference. I can replicate the problem on Win7 64bit with Strawberry 5.16.2, MinGW 4.6.3. Some quick google fu suggests a MinGW 4.6 problem. A starting point for your investigations.

    Update: Follow this.

      Thanks a lot Marto. I'll see if I can find a workaround and report back here if I do.

Re: Installing Imager::QRCode on windows 8
by syphilis (Chancellor) on Nov 14, 2013 at 01:14 UTC
    The undefined references should be resolved by linking to the pthreads library.
    Strawberry seems to provide pthreads - there's a c\x86_64-w64-mingw32\lib\libpthread.a which is probably the import library to which you should link.

    I think the corrected version of the failing g++ -o ... command would have:
    -L"C:\strawberry\c\x86_64-w64-mingw32\lib -lpthread"
    inserted between the -lcomtl32 and the dll.exp.
    You could 'cd' to the build directory and run by hand (copy'n'paste it in to the command line, then hit 'Enter') that *corrected* version of that failing command.
    Then run dmake test and dmake install
    Or you could find some other way of correcting the build procedure.

    The strawberry mailing list could probably provide good help if all else fails.


    UPDATE: I just tried the hack I suggested above, and it worked fine for me. (Note that my libpthread.a is in a different location to the OP's. Modify accordingly.)
      That worked on windows 8 too. Thanks a lot.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://1062405]
Approved by marto
Front-paged by toolic
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (7)
As of 2018-06-21 20:56 GMT
Find Nodes?
    Voting Booth?
    Should cpanminus be part of the standard Perl release?

    Results (119 votes). Check out past polls.