无法编译 openssl,因为无法识别 'cl'

can't compile openssl because of 'cl' is not recognized

我正在尝试为 python 脚本编译 openssl 库。我正在使用 Windows x64 位。

我现在正在按照以下步骤操作:https://github.com/dsoprea/M2CryptoWindows

它一直有效,直到我在 VS 2015 的开发人员命令提示符中键入此命令 nmake -f ms\ntdll.mak。 我收到此错误:

'cl' is not recognized as an internal or external command,
operable program or batch file.
NMAKE : fatal error U1077: 'cl' : return code '0x1'
Stop.

我查看了本论坛以前的帖子。解决方案说将此路径添加到环境变量:

C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin

没有解决问题。此外,当我浏览 bin 目录时,我没有看到他们在他们的解决方案中指向的文件,即:vcvars32.bat。这就是我所看到的:

你能帮忙吗?我也想知道为什么 VS 2015 安装在 Program Files (86) 而不是 64 中?

请注意,我安装了 SWIG 并添加了环境变量:C:\grr-build\swigwin-3.0.6

更新: 我确实从 VS 安装了 VC++ 工具。我正在使用 VS 2015 社区版。我重复了这些步骤,这次我在输入时遇到了不同的错误:nmake -f ms\ntdll.mak 错误说:

C:\grr-build\openssl-1.0.2d>nmake -f ms\ntdll.mak

Microsoft (R) Program Maintenance Utility Version 14.00.23026.0
Copyright (C) Microsoft Corporation.  All rights reserved.

C:\grr-build\openssl-1.0.2d>nmake -f ms\ntdll.mak

Microsoft (R) Program Maintenance Utility Version 14.00.23026.0
Copyright (C) Microsoft Corporation.  All rights reserved.

Building OpenSSL
        perl .\util\copy-if-different.pl ".\crypto\buildinf.h" "tmp32dll\buildin
f.h"
Copying: ./crypto/buildinf.h to tmp32dll/buildinf.h
        perl .\util\copy-if-different.pl ".\crypto\opensslconf.h" "inc32\openssl
\opensslconf.h"
NOT copying: ./crypto/opensslconf.h to inc32/openssl/opensslconf.h
        ml64 /c /Cp /Cx /Zi /Fotmp32dll\x86_64cpuid.obj tmp32dll\x86_64cpuid.asm

'ml64' is not recognized as an internal or external command,
operable program or batch file.
NMAKE : fatal error U1077: 'ml64' : return code '0x1'
Stop.

C:\grr-build\openssl-1.0.2d>

更新: 在执行下面发布的解决方案后,此问题已得到解决,但请记住,您需要为 nasm 设置环境变量。

C++ 工具在 Visual Studio 2015 中默认未安装。运行 重新设置,并在“custom”下安装 C++ 部分: