【问题标题】:can't compile openssl because of 'cl' is not recognized无法编译openssl,因为'cl'无法识别
【发布时间】:2015-07-22 12:53:18
【问题描述】:

我正在尝试为 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 设置环境变量。

【问题讨论】:

    标签: python visual-studio openssl swig


    【解决方案1】:

    在 Visual Studio 2015 中默认不安装 C++ 工具。再次运行安装程序,并在“custom”下安装 C++ 部分:

    【讨论】:

    • 现在缺少 ml64.exe。我在 "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\amd64\"C:\Program Files (x86)\Microsoft Visual Studio 14.0 下看到它\VC\bin\x86_amd64
    • 在我为 nasm 添加环境变量后,此错误已解决。但我仍在努力解决另一个新问题。我在新帖子中发布了它。
    猜你喜欢
    • 1970-01-01
    • 2020-01-20
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多