首页 > 解决方案 > 从 CPAN 安装模块时无法识别 dmake 命令

问题描述

尝试使用 Active Perl 从 CPAN 安装 Win32::API 时,安装不成功。问题源于以下错误:

'dmake' is not recognized as an internal or external command,

我该如何解决这个问题?


的完整输出cpan Win32::API

Loading internal logger. Log::Log4perl recommended for better logging
Reading 'C:\Perl64\cpan\Metadata'
  Database was generated on Sat, 21 Mar 2020 04:17:03 GMT
CPAN: LWP::UserAgent loaded ok (v6.31)
Fetching with LWP:
http://ppm.activestate.com/CPAN/authors/01mailrc.txt.gz
CPAN: YAML::XS loaded ok (v0.69)
Reading 'C:\Perl64\cpan\sources\authors\01mailrc.txt.gz'
CPAN: Compress::Zlib loaded ok (v2.092)
............................................................................DONE
Fetching with LWP:
http://ppm.activestate.com/CPAN/modules/02packages.details.txt.gz
Reading 'C:\Perl64\cpan\sources\modules\02packages.details.txt.gz'
  Database was generated on Sun, 22 Mar 2020 05:41:03 GMT
.............
  New CPAN.pm version (v2.27) available.
  [Currently running version is v2.20]
  You might want to try
    install CPAN
    reload cpan
  to both upgrade CPAN.pm and run the new version without leaving
  the current session.


...............................................................DONE
Fetching with LWP:
http://ppm.activestate.com/CPAN/modules/03modlist.data.gz
Reading 'C:\Perl64\cpan\sources\modules\03modlist.data.gz'
DONE
Writing C:\Perl64\cpan\Metadata
Running install for module 'Win32::API'
CPAN: Digest::SHA loaded ok (v6.01)
Checksum for C:\Perl64\cpan\sources\authors\id\B\BU\BULKDD\Win32\Win32-API-0.84.tar.gz ok
CPAN: Archive::Tar loaded ok (v2.30)
Win32-API-0.84/
....
Win32-API-0.84/Type.pm
Win32-API-0.84/TYPEMAP
Win32-API-0.84/typemap56
Win32-API-0.84/W32ATest.pm
CPAN: CPAN::Meta::Requirements loaded ok (v2.140)
CPAN: Parse::CPAN::Meta loaded ok (v2.150010)
CPAN: CPAN::Meta loaded ok (v2.150010)
CPAN: Module::CoreList loaded ok (v5.20181129_28)
Configuring B/BU/BULKDD/Win32/Win32-API-0.84.tar.gz with Makefile.PL
Checking if your kit is complete...
Looks good
Warning: prerequisite Encode::compat 0 not found.
Warning: prerequisite Math::Int64 0 not found.
Writing MYMETA.yml and MYMETA.json
Generating a dmake-style Makefile
Writing Makefile for Win32::API
Writing MYMETA.yml and MYMETA.json
  BULKDD/Win32/Win32-API-0.84.tar.gz
  C:\Perl64\bin\perl.exe Makefile.PL INSTALLDIRS=site -- OK
Running make for B/BU/BULKDD/Win32/Win32-API-0.84.tar.gz
---- Unsatisfied dependencies detected during ----
----    BULKDD/Win32/Win32-API-0.84.tar.gz    ----
    Encode::compat [build_requires]
    Math::Int64 [build_requires]
Running install for module 'Encode::compat'
Checksum for C:\Perl64\cpan\sources\authors\id\A\AU\AUTRIJUS\Encode-compat-0.07.tar.gz ok
....
Encode-compat-0.07/META.yml
Encode-compat-0.07/Changes
Encode-compat-0.07/t/
Encode-compat-0.07/t/1-basic.t
Encode-compat-0.07/t/0-signature.t
Encode-compat-0.07/MANIFEST
Encode-compat-0.07/SIGNATURE
Encode-compat-0.07/Makefile.PL
Encode-compat-0.07/README
Configuring A/AU/AUTRIJUS/Encode-compat-0.07.tar.gz with Makefile.PL
Checking if your kit is complete...
Looks good
Generating a dmake-style Makefile
Writing Makefile for Encode::compat
Writing MYMETA.yml and MYMETA.json
  AUTRIJUS/Encode-compat-0.07.tar.gz
  C:\Perl64\bin\perl.exe Makefile.PL INSTALLDIRS=site -- OK
Running make for A/AU/AUTRIJUS/Encode-compat-0.07.tar.gz
'dmake' is not recognized as an internal or external command,
operable program or batch file.
  AUTRIJUS/Encode-compat-0.07.tar.gz
  dmake -- NOT OK
Running install for module 'Math::Int64'
Checksum for C:\Perl64\cpan\sources\authors\id\S\SA\SALVA\Math-Int64-0.54.tar.gz ok
Math-Int64-0.54/
Math-Int64-0.54/COPYING
Math-Int64-0.54/Changes
.....
Configuring S/SA/SALVA/Math-Int64-0.54.tar.gz with Makefile.PL
Using IV backend
fileparse(): need a valid pathname at C:/Perl64/site/lib/ExtUtils/CBuilder/Base.pm line 50.
Checking for stdlib.h... Warning: No success on command[C:\Perl64\bin\perl.exe Makefile.PL INSTALLDIRS=site]
  SALVA/Math-Int64-0.54.tar.gz
  C:\Perl64\bin\perl.exe Makefile.PL INSTALLDIRS=site -- NOT OK
  BULKDD/Win32/Win32-API-0.84.tar.gz
  Has already been unwrapped into directory C:\Perl64\cpan\build\Win32-API-0.84-2
  BULKDD/Win32/Win32-API-0.84.tar.gz
  Has already been prepared
Running make for B/BU/BULKDD/Win32/Win32-API-0.84.tar.gz
Warning: Prerequisite 'Encode::compat => 0' for 'BULKDD/Win32/Win32-API-0.84.tar.gz' failed when processing 'AUTRIJUS/Encode-compat-0.07.tar.gz' with 'make => NO'. Continuing, but chances to succeed are limited.
Warning: Prerequisite 'Math::Int64 => 0' for 'BULKDD/Win32/Win32-API-0.84.tar.gz' failed when processing 'SALVA/Math-Int64-0.54.tar.gz' with 'writemakefile => NO 'C:\Perl64\bin\perl.exe Makefile.PL INSTALLDIRS=site' returned status 6400'. Continuing, but chances to succeed are limited.
'dmake' is not recognized as an internal or external command,
operable program or batch file.
  BULKDD/Win32/Win32-API-0.84.tar.gz
  dmake -- NOT OK

标签: perlwinapimodule

解决方案


我有 ActivePerl 并且能够安装(一些)模块。我正在使用 MinGW,我所要做的就是复制它的 make 并重命名副本 dmake.exe。那是为我做的。

或者,有一种方法可以告诉 CPAN 使用哪个 make:在 cpan 中,使用命令

cpan> o conf make <your make path and executable>

我从这篇文章中得到了这个答案。我确实遇到了其他模块的不同问题。


推荐阅读