CMake Error Building Blender 2.8 with VS 2017 on Win10

I tried Build blender2.8 : cmake error, but I have produced same error. My CMake version is 3.12.2.

Following is terminal output.

D:\blender_dev\blender>make.bat
No explicit msvc version requested, autodetecting version.


** Visual Studio 2017 Developer Command Prompt v15.8.7
** Copyright © 2017 Microsoft Corporation


[vcvarsall.bat] Environment initialized for: ‘x64’
Compiler Detection successful, detected VS2017
Building blender with VS2017 for x64 in D:\blender_dev\blender…\build_windows__x64_vc15_Release
– The C compiler identification is unknown
– The CXX compiler identification is unknown
CMake Error at CMakeLists.txt:107 (project):
No CMAKE_C_COMPILER could be found.

CMake Error at CMakeLists.txt:107 (project):
No CMAKE_CXX_COMPILER could be found.

– Configuring incomplete, errors occurred!
See also “D:/blender_dev/build_windows__x64_vc15_Release/CMakeFiles/CMakeOutput.log”.
See also “D:/blender_dev/build_windows__x64_vc15_Release/CMakeFiles/CMakeError.log”.

CMakeError.log says that can not open CMakeCCompilerId.c. But CMakeCCompilerId.c exists. I cite a part of translated CMakeError.log.

Compiling the C compiler identification source file “CMakeCCompilerId.c” failed.
Compiler:
Build flags:
Id flags:
The output was:
1

.NET Framework for Microsoft ® Build Engine version 15.8.169+g1ccb72aefa
Copyright © Microsoft Corporation.All rights reserved.
Building have started at 2018/10/11 10:36:24

project on node 1 “D:\blender_dev\build\CMakeFiles\3.12.2\CompilerIdC\CompilerIdC.vcxproj” (default target)。

PrepareForBuild:
Creating directory “Debug”
Creating directory “Debug\CompilerIdC.tlog”

InitializeBuildStatus:
“AlwaysCreate” flag is set, creating directory “Debug\CompilerIdC.tlog\unsuccessfulbuild”

ClCompile:
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.15.26726\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: Can not open file ‘CMakeCCompilerId.c’:No such file or directory [D:\blender_dev\build\CMakeFiles\3.12.2\CompilerIdC\CompilerIdC.vcxproj]

Building project “D:\blender_dev\build\CMakeFiles\3.12.2\CompilerIdC\CompilerIdC.vcxproj” (default target) is finished – failed
failed to build

“D:\blender_dev\build\CMakeFiles\3.12.2\CompilerIdC\CompilerIdC.vcxproj” (default target) (1) ->

(ClCompile target ->

c1 : fatal error C1083: Can not open file ‘CMakeCCompilerId.c’:No such file or directory [D:\blender_dev\build\CMakeFiles\3.12.2\CompilerIdC\CompilerIdC.vcxproj]

When I open the CompilerIdC.vcxproj in MSVC, the full path of the source file have been broken.

Folder nest would have problem. When move CompilerIdC to D:/, the project can compile in MSVC.

Is this able to fix?

Looks like the C++ compilers are missing, Be sure you have the Desktop development with C++ workload selected in the visual studio installer.

I have installed MSVC several times. But it did not solve the problem. My Desktop develolpment with C++ workload has following options.

  • Just-In-Time debugger
  • latest VC++ 2017 15.8 v14.15
  • Windows 10 SDK(10.0.17134.0)
  • Visual C++ tool for CMake