【问题标题】:Why do I get an error when creating an LLVM.sln file with cmake?为什么使用 cmake 创建 LLVM.sln 文件时会出错?
【发布时间】:2017-09-07 01:16:49
【问题描述】:

按照http://clang.llvm.org/get_started.html 中的指南,我尝试在 Windows 上构建 Clang 但是,当我尝试使用 cmake 创建 LLVM.sln 文件时出现错误:

CMake Warning at CMakeLists.txt:48 (message):
  Visual Studio generators use the x86 host compiler by default, even for
  64-bit targets.  This can result in linker instability and out of memory
  errors.  To use the 64-bit host compiler, pass -Thost=x64 on the CMake
  command line.


CMake Error at CMakeLists.txt:54 (project):

Failed to run MSBuild command:

  MSBuild.exe

to get the value of VCTargetsPath:

Configuring incomplete, errors occurred!
See also "H:/build/CMakeFiles/CMakeOutput.log".

如何解决这个问题并生成 Visual Studio 2017 文件?

【问题讨论】:

    标签: visual-studio cmake clang llvm


    【解决方案1】:
    • 转到卸载中心(控制面板\程序\程序和功能)
    • 点击“Microsoft Visual Studio 社区 2015 更新”
    • 点击更改
    • 将打开一个 Visual Studio 面板,单击“修复”选项卡并等待 15 分钟,然后重新启动系统。这将修复 MSBuild.exe 中的 Cmake 错误

    【讨论】:

      【解决方案2】:
      1. “Failed to run MSBuild command”表示 CMake 根本找不到 Visual Studio,可能意味着您在下拉菜单中选择了错误的 Visual Studio 版本。这可能意味着您没有正确安装 Visual Studio。

      2. 您看到的警告不是错误,只是警告。由于 CMake 很愚蠢,并且不知道它是从 GUI 中运行的,因此错误消息没有帮助,就像构建 C/C++ 世界的传统一样。为了修复它,您删除缓存,然后再次单击“生成”。然后,您可以在文本字段中指定 -T 的参数,在其中输入“host=x64”。

      【讨论】:

        猜你喜欢
        • 2012-04-30
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2022-06-15
        • 2020-05-22
        • 2016-08-13
        • 1970-01-01
        相关资源
        最近更新 更多