我正在尝试运行一个在Windows和Linux上工作的CMAKE项目。当我试图运行CMAKE来生成构建文件时,我会得到以下错误:
我检查了其他帖子以了解此错误,其中大多数建议重新安装Visual,但没有帮助。
检查错误日志会给我以下结果:
Compiling the C compiler identification source file "CMakeCCompilerId.c" failed. Compiler: Build flags: Id flags: The output was: Microsoft (R) Build Engine version 15.9.21+g9802d43bc3 for .NET Framework Build started 1/11/2019 15:31:21. Project "C:\Users\user\Documents\projects\dsa_opengl_examples\build\CMakeFiles\3.13.2\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\2017\Community\VC\Tools\MSVC\14.16.27023\bin\HostX86\x64\CL.exe /c /nologo /W0 /WX- /diagnostics:classic /Od /D _MBCS /Gm- /EHsc /RTC1 /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Zc:inline /Fo"Debug\\" /Fd"Debug\vc141.pdb" /Gd /TC /FC /errorReport:queue CMakeCCompilerId.c CMakeCCompilerId.c c1 : fatal error C1083: Cannot open source file: 'CMakeCCompilerId.c': No such file or directory [C:\Users\user\Documents\projects\dsa_opengl_examples\build\CMakeFiles\3.13.2\CompilerIdC\CompilerIdC.vcxproj] Done Building Project "C:\Users\user\Documents\projects\dsa_opengl_examples\build\CMakeFiles\3.13.2\CompilerIdC\CompilerIdC.vcxproj" (default targets) -- FAILED. Build FAILED. "C:\Users\user\Documents\projects\dsa_opengl_examples\build\CMakeFiles\3.13.2\CompilerIdC\CompilerIdC.vcxproj" (default target) (1) -> (ClCompile target) ->