“nmake”不被识别为内部或外部命令

问题描述 投票:0回答:2

我想根据这个指令构建c++库“botan”:

https://botan.randombit.net/handbook/building.html
(适用于 Windows)

第二个命令是这样的:

nmake

在结果中我得到

'nmake' is not recognized as an internal or external command

当我尝试打开 nmake.exe 后,最终得到以下结果:

cl /DBOTAN_DLL=__declspec(dllexport)  /EHs /GR /D_WIN32_WINNT=0x0600 /MD /bigobj /O2 /Oi -DBOTAN_IS_BEING_BUILT /W4 /wd4250 /wd4251 /wd4275 /wd4127  /Ibuild\include /Ibuild\include\external /nologo /c C:/botan/botan/Botan-2.17.2/src/lib/asn1/alg_id.cpp /Fobuild\obj\lib\asn1_alg_id.obj

'cl' is not recognized as an internal or external command

NMAKE : fatal error U1077: cl : returned code "0x1"

Stop.

问题:如何连接nmake,或者如何构建botan库?

c++ qt nmake botan
2个回答
4
投票

构建指令假设

nmake
位于 PATH 上的某个位置。如果您运行随机的
cmd
shell,情况可能不会如此。此外,
nmake
假设其他可执行文件也将位于 PATH 上。

对于 Visual Studio,有一个 Visual Studio 命令提示符。这是安装文件夹中的批处理文件。运行此命令会将 PATH 设置为特定的 Visual Studio 安装。因此,您可以运行属于该 Visual Studio 安装的

nmake


0
投票

对我来说,运行 VsDevCmd.bat 不起作用。 我在路径“C:\Program Files\Microsoft Visual Studio�2\Community\VC\Tools\MSVC .40.33807 in\Hostx64\x64”中有 nmake 可执行文件

将其添加到 Path 系统环境变量中,重新启动命令提示符即可工作。

参考:https://github.com/Z3Prover/z3/issues/4756#issuecomment-717358194

© www.soinside.com 2019 - 2024. All rights reserved.