【问题标题】:'nmake' is not recognized as an internal or external command'nmake' 未被识别为内部或外部命令
【发布时间】:2021-03-09 03:49:12
【问题描述】:

我想根据这个指令构建 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库?

【问题讨论】:

  • 您在 Windows 上使用什么编译器?你用的是什么外壳? nmake 是一个相当原始的工具,但它仍然包含在一些 Visual Studio 安装中。
  • 我使用 cmd,当我运行 nmake.exe 时仍然收到以下消息,以响应“cl”不被识别为内部或外部命令,

标签: c++ qt nmake botan


【解决方案1】:

构建说明假定 nmake 位于 PATH 中的某个位置。如果你运行一个随机的cmd shell,这可能不会是这种情况。此外,nmake 假定其他可执行文件也将位于 PATH 上。

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

【讨论】:

  • 我大概可以知道这个文件是怎么调用的?
  • @unwx:在 Visual Studio 2019 中,它是来自例如的 vsdevcmd.bat c:\program files (x86)\microsoft visual studio\2019\community\Common7\Tools(或 Enterprise 等 - 您可以同时安装多个 Visual Studio)
  • 如果您正在使用 Visual Studio 命令提示符并且仍然收到此消息,您可能没有将它作为组件包含在您的 Visual Studio 安装中。转到您的 Visual Studio 安装程序 -> 修改 -> 单个组件选项卡。在编译器、构建工具和运行时下,选中“MSVC v142 - VS 2019 C++ x64x/x86 构建工具(最新)”,可能还检查“C++/CLI 支持 v142 构建工具(最新)”
猜你喜欢
  • 2013-10-03
  • 2014-04-29
  • 1970-01-01
  • 1970-01-01
  • 2013-10-06
  • 2013-10-11
  • 2013-01-25
  • 2016-10-01
  • 2022-01-22
相关资源
最近更新 更多