CMake:Win10 CMakeGUI的C和CXX编译器标识未知 [英] CMake : C and CXX compiler identification is unknown Win10 CMakeGUI

查看:385
本文介绍了CMake:Win10 CMakeGUI的C和CXX编译器标识未知的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

因此,我正在尝试根据此教程在youtube上配置文件,该文件非常简单:

So I am trying to configure a file based on this tutorial on youtube which is very simple :

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

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

I use CMake GUI in Windows 10 and I have a running Visual Studio 2015 which is able to build c++ projects already (I've used it for some time)

我使用 Visual Studio 15 2017

I use "Visual Studio 15 2017"

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

I created a folder named hellocmake and hellocmake/build for both inputs:

我的输入

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

However when I tried to configure, it says that


CMakeLists.txt:1(PROJECT)的CMake错误:

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

找不到CMAKE_C_COMPILER。

CMakeLists.txt上的CMake错误:1(项目) :

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

找不到CMAKE_CXX_COMPILER。

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

生成标志:
Id标志:

The error log specifies that it can't find the two compiler files : Compiling the C compiler identification source file "CMakeCCompilerId.c" failed. Compiler:
Build flags: Id flags:

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文件,并尝试手动将它们添加到同一文件夹中,但是它无法解决问题

I tried downloading the "CMakeCXXCompilerId.cpp" and "CMakeCXXCompilerId.c" files and try to add them manually in the same folder, but it doesnt solve it

我试图查找其他一些情况类似的资料,但我似乎无法理解。
我的旧计算机不存在此问题,因此我认为它与Visual Studio有关?

I tried to look up several other sources which have a similar case but I can't seem to understand them. This problem didn't exist with my old computer so I assume it has something to do with the Visual Studio ?

谢谢大家,我们将提供任何帮助感激

Thank you guys, any help will be appreciated

推荐答案

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

You selected Visual Studio 2017 which you don't have installed. I think you confused the actual version number (which is 15 for VS2017) for the year in which the version was released. Pick a VS2015 generator (version number 14) and it should work.

这篇关于CMake:Win10 CMakeGUI的C和CXX编译器标识未知的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆