【问题标题】:CMake cannot find Visual Studio 140 toolset on a 2017 installationCMake 在 2017 安装中找不到 Visual Studio 140 工具集
【发布时间】:2017-05-28 08:25:55
【问题描述】:

新的 Visual Studio 2017 安装程序可以选择安装旧的 VS 140 编译器工具链以及新的 VS 141 工具集。这是 2017 安装程序中的选项

安装程序成功安装了 v140 工具集,我什至可以在我的 Visual Studio 项目/解决方案中在 v140 和 v141 之间切换工具集并成功构建,但我无法使用 CMake 使用 v140 工具集构建项目。当我跑步时

cmake -G"Visual Studio 14 2015" ../Source

cmake 找不到编译器和工具集。

-- The C compiler identification is unknown
-- The CXX compiler identification is unknown
CMake Error at CMakeLists.txt:2 (project):
  No CMAKE_C_COMPILER could be found.



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



-- Configuring incomplete, errors occurred!

但是,正如预期的那样,我可以使用Visual Studio 15 2017 选项成功构建。有什么方法可以在不安装 VS2015 的情况下使用带有 cmake 的旧工具集?

【问题讨论】:

    标签: visual-studio cmake visual-studio-2017


    【解决方案1】:

    您可以在调用cmake 时使用-T 标志指定工具集。请参阅文档 herehere

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2019-04-02
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-02-06
      • 1970-01-01
      • 2017-09-25
      相关资源
      最近更新 更多