Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/powershell/12.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Powershell 为什么在生成';nMakefiles';?_Powershell_Cmd_Cmake_Visual Studio 2017 - Fatal编程技术网

Powershell 为什么在生成';nMakefiles';?

Powershell 为什么在生成';nMakefiles';?,powershell,cmd,cmake,visual-studio-2017,Powershell,Cmd,Cmake,Visual Studio 2017,当我通过以下方式加载开发人员工具时: ********************************************************************** ** Visual Studio 2017 Developer Command Prompt v15.9.7 ** Copyright (c) 2017 Microsoft Corporation *************************************************************

当我通过以下方式加载开发人员工具时:

********************************************************************** ** Visual Studio 2017 Developer Command Prompt v15.9.7 ** Copyright (c) 2017 Microsoft Corporation ********************************************************************** [vcvarsall.bat] Environment initialized for: 'x64' 我得到:

CMake Error: Could not create named generator 'NMake Generators Visual Studio 16 2019 = Generates Visual Studio 2019 project files. Use -A option to specify architecture. * Visual Studio 15 2017 [arch] = Generates Visual Studio 2017 project files. Optional [arch] can be "Win64" or "ARM". Visual Studio 14 2015 [arch] = Generates Visual Studio 2015 project files. Optional [arch] can be "Win64" or "ARM". Visual Studio 12 2013 [arch] = Generates Visual Studio 2013 project files. Optional [arch] can be "Win64" or "ARM". Visual Studio 11 2012 [arch] = Generates Visual Studio 2012 project files. Optional [arch] can be "Win64" or "ARM". Visual Studio 10 2010 [arch] = Generates Visual Studio 2010 project files. Optional [arch] can be "Win64" or "IA64". Visual Studio 9 2008 [arch] = Generates Visual Studio 2008 project files. Optional [arch] can be "Win64" or "IA64". Borland Makefiles = Generates Borland makefiles. NMake Makefiles = Generates NMake makefiles. NMake Makefiles JOM = Generates JOM makefiles. Green Hills MULTI = Generates Green Hills MULTI files (experimental, work-in-progress). MSYS Makefiles = Generates MSYS makefiles. MinGW Makefiles = Generates a make file for use with mingw32-make. # etc. 它工作正常:

-- The C compiler identification is MSVC 19.16.27027.1 -- The CXX compiler identification is MSVC 19.16.27027.1 # etc. --C编译器标识为MSVC 19.16.27027.1 --CXX编译器标识为MSVC 19.16.27027.1 #等等。
知道为什么
cmake
在PowerShell中工作而不是在CMD中工作吗?

Windows命令提示符不将单引号识别为引号字符。您必须使用双引号

改变

cmake -G 'NMake Makefiles'

问题就会消失

-- The C compiler identification is MSVC 19.16.27027.1 -- The CXX compiler identification is MSVC 19.16.27027.1 # etc.
cmake -G 'NMake Makefiles'
cmake -G "NMake Makefiles"