http://www.perlmonks.org?node_id=1013866

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

I always have trouble with cpan!
This time I tried to install Math::FFT, and it died with this error message:

dlltool --def FFT.def --output-exp dll.exp
'dlltool' is not recognized as an internal or external command, operable program or batch file.
dmake.exe:  Error code 129, while making 'blib\arch\auto\Math\FFT\FFT.dll'
  RKOBES/Math-FFT-1.28.tar.gz
C:\Perl\site\bin\dmake.exe -- NOT OK    
CPAN: YAML::XS loaded ok (v0.35)
Running make test
  Can't test without successful make
Running make install
  Make had returned bad status, install seems impossible

The file C:\Perl\site\bin\dmake.exe DOES exist ,24kb, dated 10/3/2011.

What or where is dlltool, which it can't find?
How can I find what is wrong with these files or get proper versions?
Or, is there some other command to use other than cpan?
I have something called cpanplus, but the system doesn't recognize it and I can't find an executable,



If anyone should be interested, here is the entire cpan screendump:
C:\Perl\hsf\Options>cpan install Math::FFT

Set up gcc environment - 3.4.5 (mingw-vista special r3)
CPAN: Term::ANSIColor loaded ok (v3.00)
CPAN: Storable loaded ok (v2.22)
Going to read 'C:\Perl\cpan\Metadata'
  Database was generated on Thu, 17 Jan 2013 11:53:02 GMT
Running install for module 'Math::FFT'
Running make for R/RK/RKOBES/Math-FFT-1.28.tar.gz
CPAN: Digest::SHA loaded ok (v5.62)
CPAN: Compress::Zlib loaded ok (v2.033)
Checksum for C:\Perl\cpan\sources\authors\id\R\RK\RKOBES\Math-FFT-1.28.tar.gz ok

CPAN: Archive::Tar loaded ok (v1.76)
Math-FFT-1.28/
Math-FFT-1.28/t/
Math-FFT-1.28/t/results.pl
Math-FFT-1.28/t/spctrl.dat
Math-FFT-1.28/t/fft.t
Math-FFT-1.28/t/stats.t
Math-FFT-1.28/t/apps.t
Math-FFT-1.28/FFT.xs
Math-FFT-1.28/FFT.pm
Math-FFT-1.28/Changes
Math-FFT-1.28/FFT.h
Math-FFT-1.28/MANIFEST
Math-FFT-1.28/typemap
Math-FFT-1.28/arrays.c
Math-FFT-1.28/META.yml
Math-FFT-1.28/fft4g.c
Math-FFT-1.28/arrays.h
Math-FFT-1.28/INSTALL
Math-FFT-1.28/Makefile.PL
Math-FFT-1.28/README
CPAN: File::Temp loaded ok (v0.22)
CPAN: Parse::CPAN::Meta loaded ok (v1.4401)

  CPAN.pm: Going to build R/RK/RKOBES/Math-FFT-1.28.tar.gz

Set up gcc environment - 3.4.5 (mingw-vista special r3)
Checking if your kit is complete...
Looks good
Writing Makefile for Math::FFT
cp FFT.pm blib\lib\Math\FFT.pm
C:\Perl\bin\perl.exe C:\Perl\lib\ExtUtils\xsubpp  -typemap C:\Perl\lib\ExtUtils\
typemap -typemap typemap  FFT.xs > FFT.xsc && C:\Perl\bin\perl.exe -MExtUtils::C
ommand -e "mv" -- FFT.xsc FFT.c
C:/Perl/site/bin/gcc.exe -c     -DNDEBUG -DWIN32 -D_CONSOLE -DNO_STRICT -DHAVE_DES_FCRYPT -DUSE_SITECUSTOMIZE -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -DUSE_
PERLIO -D_USE_32BIT_TIME_T -DPERL_MSVCRT_READFIX -DHASATTRIBUTE -fno-strict-aliasing -mms-bitfields -O2           -DVERSION=\"1.28\"    -DXS_VERSION=\"1.28\"  "
-IC:\Perl\lib\CORE"   FFT.c
C:/Perl/site/bin/gcc.exe -c     -DNDEBUG -DWIN32 -D_CONSOLE -DNO_STRICT -DHAVE_DES_FCRYPT -DUSE_SITECUSTOMIZE -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -DUSE_
PERLIO -D_USE_32BIT_TIME_T -DPERL_MSVCRT_READFIX -DHASATTRIBUTE -fno-strict-aliasing -mms-bitfields -O2           -DVERSION=\"1.28\"    -DXS_VERSION=\"1.28\"  "
-IC:\Perl\lib\CORE"   fft4g.c
C:/Perl/site/bin/gcc.exe -c     -DNDEBUG -DWIN32 -D_CONSOLE -DNO_STRICT -DHAVE_DES_FCRYPT -DUSE_SITECUSTOMIZE -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -DUSE_
PERLIO -D_USE_32BIT_TIME_T -DPERL_MSVCRT_READFIX -DHASATTRIBUTE -fno-strict-aliasing -mms-bitfields -O2           -DVERSION=\"1.28\"    -DXS_VERSION=\"1.28\"  "
-IC:\Perl\lib\CORE"   arrays.c
Running Mkbootstrap for Math::FFT ()
C:\Perl\bin\perl.exe -MExtUtils::Command -e "chmod" -- 644 FFT.bs
C:\Perl\bin\perl.exe -MExtUtils::Mksymlists \
     -e "Mksymlists('NAME'=>\"Math::FFT\", 'DLBASE' => 'FFT', 'DL_FUNCS' => {  }
, 'FUNCLIST' => [], 'IMPORTS' => {  }, 'DL_VARS' => []);"
Set up gcc environment - 3.4.5 (mingw-vista special r3)
dlltool --def FFT.def --output-exp dll.exp
'dlltool' is not recognized as an internal or external command, operable program or batch file.
dmake.exe:  Error code 129, while making 'blib\arch\auto\Math\FFT\FFT.dll'
  RKOBES/Math-FFT-1.28.tar.gz
  C:\Perl\site\bin\dmake.exe -- NOT OK    CPAN: YAML::XS loaded ok (v0.35)
Running make test
  Can't test without successful make
Running make install
  Make had returned bad status, install seems impossible

Replies are listed 'Best First'.
Re: cpan dies for bad dlltool & dmake.exe
by tobyink (Canon) on Jan 17, 2013 at 20:06 UTC

    What flavour of Perl are you using? The two usual Windows ones are ActivePerl and Strawberry Perl.

    If you're using ActivePerl the first port of call for installing Perl modules should be the Perl Package Manager (PPM) which is pre-installed with ActivePerl. It offers a graphical interface, and there's also a command-line ppm command.

    If you wish to keep trying to install via CPAN, a quick Google search seems to suggest that dlltool is bundled with MinGW.

    perl -E'sub Monkey::do{say$_,for@_,do{($monkey=[caller(0)]->[3])=~s{::}{ }and$monkey}}"Monkey say"->Monkey::do'

      My guess is that OP is using ActiveState Perl and MinGW as indicated by the "Set up gcc environment - 3.4.5 (mingw-vista special r3)" line I see in the CPAN build output. I used to get that line with Active / MinGW.

      I've moved to Strawberry as the MinGw compiler (and associated tools like 'dlltool') are bundled with the distribution making life much easier.

      VinsWorldcom@C:\Users\VinsWorldcom> which dlltool C:\strawberry\c\bin\dlltool.exe
      I'm using Active States Perl v5.12.4.

      Anyway I tried PPM, as you suggested, and it appears to have worked. At least it says it did. :-)

      Thank You!

      So then I wondered - How come I didn't know about this? I searched the perl documentation folder, but found no reference to it.

      I finally tracked down an html describing it in /Perl/Active%20Perl/html/bin/ppm.html.

      I suppose it's no secret that the AS distribution is a foul, disorganized kloodge, with multiple outdated copies of each file, scattered all over the folder tree.

        ActiveState and Strawberry Perl take two different approaches to same problem: Windows does not have a C compiler (and make tool) that is part of the OS distribution like Linux operating systems do.

        ActiveState takes the approach of using repositories of prebuilt/precompiled modules. The advantage of that approach is the end user does not need to worry about setting up a C compiler and that if there's a module available in a PPM repository, you're almost guaranteed that it will install without any issues. Unfortunately, you might also notice that in many cases the version of modules in the repository are older than the latest version available from CPAN. So if you're using ActiveState's ActivePerl, it's in your best interest to check PPM repositories for a desired module first and then install from CPAN only if you can't find it in a PPM repository.

        Strawberry Perl takes another approach. They bundle all of the necessary tools needed to directly install modules from CPAN. The idea is that if you're used to installing modules in Linux, then you can do the same thing on Windows with Strawberry Perl. However, you don't have the level of guarantee of successful module install like you do with PPM repositories for ActivePerl. Although Strawberry Perl does have a ppm utility, I personally have never used it myself.

Re: cpan dies for bad dlltool & dmake.exe
by CountZero (Bishop) on Jan 17, 2013 at 20:15 UTC
    Google is your friend: dlltool

    CountZero

    A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James

    My blog: Imperial Deltronics
      If dlltool is missing, probably other parts of the toolchain are missing, and 1 out of 75 files required in the /c/bin folder for strawberry won't solve it. I think the OP will be back with more problems soon.
        That is very well possible, but one can only help to solve the known problems as they are reported.

        Or one can use the "Helpdesk" method:

        1. Reset your computer
        2. If the above fails: Re-install your application
        3. If the above fails: Re-install Windows
        4. If the above fails: Get a new PC

        CountZero

        A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James

        My blog: Imperial Deltronics
Re: cpan dies for bad dlltool & dmake.exe
by dasgar (Priest) on Jan 17, 2013 at 20:18 UTC

    I just used Strawberry Perl 5.12.3.0 portable edition and was able to install Math::FFT directly from CPAN without any issues.

    What distribution (ActivePerl, Strawberry, etc.) and version (5.12.30, 5.16, etc.) of Perl are you using?