tangobaer has asked for the wisdom of the Perl Monks concerning the following question:

Hello community,
this is my first question - please be kind.
I try to install Win32::ToolHelp with x64 Strawberry Perl on Win7 64.
When I use cpanm I get an dmake error: Build.log:
cpanm (App::cpanminus) 1.7033 on perl 5.020002 built for MSWin32-x64-m +ulti-thread Work directory is C:\Users\Eurocom/.cpanm/work/1430810127.6240 You have make C:\Strawberry\c\bin\dmake.exe You have LWP 6.13 Falling back to Archive::Tar 2.04 Searching Win32::ToolHelp () on cpanmetadb ... --> Working on Win32::ToolHelp Fetching http://www.cpan.org/authors/id/K/KN/KNTH/Win32-ToolHelp-0.32. +tar.gz -> OK Unpacking Win32-ToolHelp-0.32.tar.gz Entering Win32-ToolHelp-0.32 Checking configure dependencies from META.yml Checking if you have ExtUtils::MakeMaker 6.58 ... Yes (7.04) Configuring Win32-ToolHelp-0.32 Running Makefile.PL Checking if your kit is complete... Looks good MakeMaker (v7.04) Warning (non-fatal): Target 'dynamic' depends on targets in skipped se +ction 'dynamic_lib' Warning (non-fatal): Target 'static' depends on targets in skipped sec +tion 'static_lib' Generating a dmake-style Makefile Writing Makefile for Win32::ToolHelp::Impl Writing MYMETA.yml and MYMETA.json Generating a dmake-style Makefile Writing Makefile for Win32::ToolHelp Writing MYMETA.yml and MYMETA.json -> OK Checking dependencies from MYMETA.json ... Checking if you have ExtUtils::MakeMaker 0 ... Yes (7.04) Building and testing Win32-ToolHelp-0.32 cp ToolHelp.pm blib\lib\Win32\ToolHelp.pm AutoSplitting blib\lib\Win32\ToolHelp.pm (blib\lib\auto\Win32\ToolHelp +) cd Impl && dmake gcc -c -s -O2 -DWIN32 -DWIN64 -DCONSERVATIVE -DPERL_TEXTMODE_SCR +IPTS -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -DUSE_PERLIO -fwrapv + -fno-strict-aliasing -mms-bitfields -s -O2 -DVERSION=\"\" +-DXS_VERSION=\"\" "-IC:\STRAWB~1\perl\lib\CORE" Impl.c ar /out:Impl.a Impl.o ar: invalid option -- / Usage: ar [emulation options] [-]{dmpqrstx}[abcDfilMNoPsSTuvV] [member +-name] [count] archive-file file... ar -M [<mri-script] commands: d - delete file(s) from the archive m[ab] - move file(s) in the archive p - print file(s) found in the archive q[f] - quick append file(s) to the archive r[ab][f][u] - replace existing or insert new file(s) into the archi +ve s - act as ranlib t - display contents of archive x[o] - extract file(s) from the archive command specific modifiers: [a] - put file(s) after [member-name] [b] - put file(s) before [member-name] (same as [i]) [D] - use zero for timestamps and uids/gids [U] - use actual timestamps and uids/gids (default) [N] - use instance [count] of name [f] - truncate inserted file names [P] - use full path names when matching [o] - preserve original dates [u] - only replace files that are newer than current archiv +e contents generic modifiers: [c] - do not warn if the library had to be created [s] - create an archive index (cf. ranlib) [S] - do not build a symbol table [T] - make a thin archive [v] - be verbose [V] - display the version number @<file> - read options from <file> --target=BFDNAME - specify the target object format as BFDNAME emulation options: No emulation specific options ar: supported targets: pe-x86-64 pei-x86-64 elf64-x86-64 elf64-l1om el +f64-k1om pe-i386 pei-i386 elf32-i386 elf64-little elf64-big elf32-lit +tle elf32-big srec symbolsrec verilog tekhex binary ihex dmake: Error code 129, while making 'Impl.a' dmake.exe: Error code 255, while making 'Impl\Impl.a' -> FAIL Installing Win32::ToolHelp failed. See C:\Users\Eurocom\.cpanm +\work\1430810127.6240\build.log for details. Retry with --force to fo +rce install it.
Please could someone explain the problem for me.
It is the first time I try to install a Win32 Module from CPAN with Strawberry Perl.
Thanks for your help !!

Replies are listed 'Best First'.
Re: Problem installing Win32::ToolHelp with Strawbeery Perl Win64
by Anonymous Monk on May 05, 2015 at 07:57 UTC
      Thanks for quick reply!
      I wanted to use Toolhelp because of my 32Bit Perlscript that uses that module.
      I followed your advice and installed Win32::Process::Info - success!
      So isnt't it possible to use Win32 Toolhelp? Do I have to change my Script?

        So isnt't it possible to use Win32 Toolhelp? Do I have to change my Script?

        Anything is possible. The two modules don't share the same API.

Re: Problem installing Win32::ToolHelp with Strawbeery Perl Win64
by syphilis (Archbishop) on May 05, 2015 at 10:49 UTC
    Please could someone explain the problem for me.

    In Impl/Makefile.PL we find:
    $opt = $Config{ar} =~ /ar\.exe$/ ? '-ru ' : '/out:';
    Change that to:
    $opt = $Config{ar} =~ /^ar/ ? '-ru ' : '/out:';
    That gets you past the problem you struck, but there's another change you need to make.
    In Impl/Impl.h, line 10 is:
    typedef unsigned long ULONG_PTR;
    Remove that line (or comment it out).
    Once those changes have been made, the module then builds and tests fine for me on 64-bit Strawberry Perl 5.20.0.
    (I built, tested and installed it by manually running "perl Makefile.PL", "dmake test" and "dmake install".)

    Cheers,
    Rob