【问题标题】:MSBuild.exe has stopped cmake errorMSBuild.exe 已停止 cmake 错误
【发布时间】:2016-12-15 21:55:09
【问题描述】:

我昨天能够使用 CMake 编译 zlib,但唯一可能的更改是安装 Windows 10 SDK 10.0.14393.33,现在我使用相同的选择配置它(Visual Studio 14 2015 win64)我收到以下错误:

知道可能出了什么问题以及如何解决吗?

The C compiler identification is unknown
CMake Error: Could not find cmake module file: C:/Users/mona/playing-for-data/renderdoc/renderdoc/3rdparty/zlib/build /CMakeFiles/3.7.1/CMakeCCompiler.cmake
CMake Error at CMakeLists.txt:4 (project):
  No CMAKE_C_COMPILER could be found.


Configuring incomplete, errors occurred!
See also "C:/Users/mona/playing-for-data/renderdoc/renderdoc/3rdparty/zlib/build /CMakeFiles/CMakeOutput.log".
See also "C:/Users/mona/playing-for-data/renderdoc/renderdoc/3rdparty/zlib/build /CMakeFiles/CMakeError.log".

【问题讨论】:

  • 在缺少模块文件C:/Users/mona/playing-for-data/renderdoc/renderdoc/3rdparty/zlib/build /CMakeFiles/3.7.1/CMakeCCompiler.cmake 的路径中,“构建”组件后有一个空格。可能,这是造成这种故障的原因。

标签: visual-studio msbuild cmake windows-10 cmake-gui


【解决方案1】:

嗯,真的很奇怪,但事实证明你必须通过右键单击可执行文件并以管理员身份运行它来运行 CMake。我不确定这是否是正确的解决方案,但现在它正在工作!!!

【讨论】:

    【解决方案2】:

    我遇到了类似的问题(在管理员模式下运行 CMake 确实会改变它运行的搜索 PATH 环境)。

    此问题是 msbuild 特有的,并且仅在较新版本的 CMake 中才会出现,因为默认构建程序已从 devenv 更改为 msbuild

    对我来说有帮助的是将以下代码放入我的 VS 工具链文件中:

    if (CMAKE_VS_DEVENV_COMMAND)
        set(CMAKE_MAKE_PROGRAM "${CMAKE_VS_DEVENV_COMMAND}" CACHE INTERNAL "")
    endif()
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-06-30
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-09-12
      • 2012-10-04
      相关资源
      最近更新 更多