关于c ++:CMake:Win10 CMakeGUI的C和CXX编译器标识未知

CMake : C and CXX compiler identification is unknown Win10 CMakeGUI

所以我试图基于这个教程在youtube上配置文件,这很简单:

我在Windows 10中使用CMake GUI,并且运行的Visual Studio 2015已能够构建c ++项目(我已经使用了一段时间)

我使用" Visual Studio 15 2017"

我为两个输入创建了一个名为hellocmake和hellocmake / build的文件夹:

我的投入

但是,当我尝试配置时,它说

CMake Error at CMakeLists.txt:1 (PROJECT):

No CMAKE_C_COMPILER could be found.

CMake Error at CMakeLists.txt:1 (PROJECT):

No CMAKE_CXX_COMPILER could be found.

错误日志指定找不到两个编译器文件:
编译C编译器标识源文件" CMakeCCompilerId.c"失败。
编译器:
建立标记:
ID标志:

1
2
3
4
5
6
7
8
9
10
11
The output was:
The system cannot find the file specified


Compiling the CXX compiler identification source file"CMakeCXXCompilerId.cpp" failed.
Compiler:  
Build flags:
Id flags:

The output was:
The system cannot find the file specified

我尝试下载" CMakeCXXCompilerId.cpp"和" CMakeCXXCompilerId.c"文件,并尝试将它们手动添加到同一文件夹中,但无法解决

我试图查找其他一些类似案例的消息来源,但我似乎无法理解它们。
我的旧计算机不存在此问题,因此我认为它与Visual Studio有关?

谢谢大家,任何帮助将不胜感激


您选择了尚未安装的Visual Studio 2017。 我认为您混淆了该版本发布年份的实际版本号(对于VS2017,为15)。 选择一个VS2015生成器(版本号14),它应该可以工作。


我同意@rubenvb的回答,并添加一个提示:在将" 15"更改为" 14"之前,应删除" CMakeCache.txt"文件。

1
cmake -G

enter image description here