c++ - CMake : C and CXX compiler identification is unknown Win10 CMakeGUI

标签 c++ windows visual-studio-2015 cmake cmake-gui

所以我正在尝试根据 youtube 上的本教程配置一个非常简单的文件:

https://www.youtube.com/watch?v=gYmgbqGfv-8

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

我使用“Visual Studio 15 2017”

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

my inputs

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

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”失败。 编译器:
构建标志: 标识标志:

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),它应该可以工作。

关于c++ - CMake : C and CXX compiler identification is unknown Win10 CMakeGUI,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40975780/

相关文章:

python-3.x - 在 Windows 10 上的 Jupyter (Pyhtong3) 中创建新笔记本的权限被拒绝

visual-studio-2015 - Windows 10 UAP 部署代码 705 和 DEP0700/DEP6100/DEP6200

html - 如何分页,让文本框相邻

c++ - 在现代 x86 硬件上编写比特流的最快方法

c++ - 用鼠标改变QWidget的宽度

c++ - 从二进制编码中提取小时、分钟和秒

c++ - 非方形屏幕上的 OpenGL 绘图线

windows - 为什么特定站点上的 HTTP/2 在 FF 中有效,但在同一台 Windows 10 计算机上的 Chrome、IE 和 Edge 中却无效?

windows - 如何在 Windows 上监控 CPU 缓存?

c - 是否可以在 visual studio 2015 中创建一个 c 解决方案?