无法编译openssl,因为无法识别“cl”

2024-05-19 15:53:48 发布

您现在位置:Python中文网/ 问答频道 /正文

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

我现在正在这样做:https://github.com/dsoprea/M2CryptoWindows

直到我在VS2015的开发人员命令提示符中键入这个命令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

你能帮忙吗?我也想知道为什么VS2015安装在程序文件(86)中,而不是64?

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

更新: 我安装了VC++工具从VS。我正在使用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设置环境变量。


Tags: orbuild错误环境变量解决方案programcryptomicrosoft