由于'cl'无法识别,无法编译openssl

时间:2015-07-22 12:53:18

标签: python visual-studio openssl swig

我正在尝试为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。这就是我所看到的:

enter image description here

你能帮忙吗?另外我想知道为什么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设置环境变量。

1 个答案:

答案 0 :(得分:8)

默认情况下,Visual Studio 2015中未安装C ++工具。再次运行安装程序,并在" custom"下安装C ++部件:

enter image description here