Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/c/56.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
CMake Visual Studio 2015 C编译器未知_C_Visual Studio 2015_Cmake - Fatal编程技术网

CMake Visual Studio 2015 C编译器未知

CMake Visual Studio 2015 C编译器未知,c,visual-studio-2015,cmake,C,Visual Studio 2015,Cmake,我第一次尝试使用cmake在Visual Studio 2015中编译一个旧的c项目,但是我一直不知道c编译器是什么。cmake的错误如下所示: Compiling the C compiler identification source file "CMakeCCompilerId.c" failed. Compiler: Build flags: Id flags: The output was: 1 Microsoft (R) Build Engine version 14.0.

我第一次尝试使用cmake在Visual Studio 2015中编译一个旧的c项目,但是我一直不知道c编译器是什么。cmake的错误如下所示:

Compiling the C compiler identification source file "CMakeCCompilerId.c" failed.
Compiler:  
Build flags: 
Id flags: 

The output was:
1
Microsoft (R) Build Engine version 14.0.25123.0
Copyright (C) Microsoft Corporation. All rights reserved.

Build started 23/06/2016 14:46:48.
Project "D:\Modules\cmake-test\build\CMakeFiles\3.6.0-    rc3\CompilerIdC\CompilerIdC.vcxproj" on node 1 (default targets).
PrepareForBuild:
Creating directory "Debug\".
Creating directory "Debug\CompilerIdC.tlog\".
InitializeBuildStatus:
Creating "Debug\CompilerIdC.tlog\unsuccessfulbuild" because "AlwaysCreate" was specified.
ClCompile:
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\CL.exe /c /nologo /W0 /WX- /Od /Oy- /D _MBCS /Gm- /EHsc /RTC1 /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Zc:inline /Fo"Debug\\" /Fd"Debug\vc140.pdb" /Gd /TC /analyze- /errorReport:queue CMakeCCompilerId.c
CMakeCCompilerId.c
Link:
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\link.exe /ERRORREPORT:QUEUE /OUT:".\CompilerIdC.exe" /INCREMENTAL:NO /NOLOGO kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /MANIFEST /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /manifest:embed /PDB:".\CompilerIdC.pdb" /SUBSYSTEM:CONSOLE /TLBID:1 /DYNAMICBASE /NXCOMPAT /IMPLIB:".\CompilerIdC.lib" /MACHINE:X86 /SAFESEH Debug\CMakeCCompilerId.obj
LINK : fatal error LNK1158: cannot run 'C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\rc.exe' [D:\Modules\cmake-test\build\CMakeFiles\3.6.0-rc3\CompilerIdC\CompilerIdC.vcxproj]
Done Building Project "D:\Modules\cmake-test\build\CMakeFiles\3.6.0-rc3\CompilerIdC\CompilerIdC.vcxproj" (default targets) -- FAILED.

Build FAILED.

"D:\Modules\cmake-test\build\CMakeFiles\3.6.0-rc3\CompilerIdC\CompilerIdC.vcxproj" (default target) (1) ->
(Link target) -> 
LINK : fatal error LNK1158: cannot run 'C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\rc.exe' [D:\Modules\cmake-test\build\CMakeFiles\3.6.0-rc3\CompilerIdC\CompilerIdC.vcxproj]

   0 Warning(s)
   1 Error(s)

Time Elapsed 00:00:00.39
我看过这些答案,但没有找到有效的解决办法

我使用的命令是

cmake -G "Visual Studio 14 2015" .
我已经试用了cmake的3.6.0-rc3和3.5.2版本

按照这个问题的说明,我在路径上找到了rc.exe


任何帮助都将不胜感激

从控制面板转到MSVC设置,修改安装并设置此标志


(对于我来说,从M$网站安装SDK奇怪地没有帮助)

你能给出你尝试过的
cmake
命令行吗?看起来像
nmake
。可能重复:已更新的问题,因为您尝试了该链接already@Florian我已经更新了问题,错误是
无法运行“C:\ProgramFiles(x86)\Microsoft Visual Studio 14.0\VC\bin\rc.exe”
。你能从命令行试试吗?