我看到了两个与我的问题相似的话题,但都没有找到对我有帮助的答案。
我得到了一台运行 Windows 7 Enterprise SP1 64 位的新笔记本电脑,我在上面安装了 Active Perl 5“版本 20,为 MSWin32-x64-多线程构建的 subversion 2 (v5.20.2)”和微软 Visual Studio Express 2015。
'C:\perl64' 和 'c:\program files (32)\Microsoft Visual Studio 14.0\VC\bin' 都在我的系统路径中 [当然没有单引号] 如果我运行 nmake在没有任何参数且 pwd 中没有 makefile 的命令行中,我收到以下消息,明确表明可以找到 nmake:
Microsoft (R) Program Maintenance Utility Version 14.00.23026.0 Copyright (C) Microsoft Corporation. All rights reserved.
NMAKE : fatal error U1064: MAKEFILE not found and no target specified Stop.
到目前为止,还不错。现在,当我运行 Makefile.PL 开始安装新包时,我收到以下消息:
It looks like you don't have either nmake.exe or dmake.exe on your PATH, so you will not be able to execute the commands from a Makefile. You can install dmake.exe with the Perl Package Manager by running:
ppm install dmake
Checking if your kit is complete... Looks good Generating a dmake-style Makefile
我不明白并想解决的是为什么 Perl 在我的 PATH 环境中看不到 nmake?我以前在许多不同的机器上安装过这个相同的包——唯一真正的变化是 Perl 和 MSVS 版本的版本号和 Perl 的位版本 [在几乎所有情况下我一直在 32 位而不是 64 位工作],但我不明白为什么这两个会对 Perl 产生影响,无法识别我的 %PATH% 中的 MSVS bin 目录
安装 dmake 或 minGW 对我来说不是一个解决方案:我已经完成了这两个操作并遇到了一系列我以前从未遇到过的错误,所以我真的很想找到一个允许我的解决方案使用 nmake - 如果之后我仍然遇到错误,我会在遇到错误时解决这些问题。
谢谢
最佳答案
编辑 C:\Perl64\lib\ExtUtils\MakeMaker.pm 并添加“require Module::Build;”在“要求导出商”之前;线。顶部现在应该看起来像这样:
# $Id$
package ExtUtils::MakeMaker;
use strict;
BEGIN {require 5.006;}
require Module::Build; # THIS IS ADDED
require Exporter;
use ExtUtils::MakeMaker::Config;
use ExtUtils::MakeMaker::version; # ensure we always have our fake version.pm
use Carp;
use File::Path;
这对我来说已经解决了。
关于Perl: 找不到 nmake,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31949834/