CMake找不到Visual C ++编译器 [英] CMake does not find Visual C++ compiler

查看:6481
本文介绍了CMake找不到Visual C ++编译器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

安装Visual Studio 2015并在之前的项目上运行CMake后,cmake错误提示找不到C编译器。

After installing Visual Studio 2015 and running CMake on a previous project, cmake errors stating that it could not find the C compiler.

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



CMake Error at CMakeLists.txt:4 (PROJECT):
  No CMAKE_CXX_COMPILER could be found.

我搜索了 cl.exe Visual Studio文件夹 C:\Program Files \Microsoft Visual Studio 14.0 ,找不到它。

如何设置CMake在Visual Studio 2015的Windows上工作?

I went searching for cl.exe in the Visual Studio folder,C:\Program Files\Microsoft Visual Studio 14.0, and could not find it.
How do I set up CMake to work on Windows with Visual Studio 2015?

推荐答案

我找到了解决方案。当Visual Studio IDE成功安装时,它没有安装任何构建工具,因此没有安装C ++编译器。通过尝试在Visual Studio 2015 GUI中手动创建C ++项目,我能够提示它下载C ++包。 Cmake然后能够找到编译器没有任何困难。

I have found the solution. While Visual Studio IDE installed successfully it did not install any build tools and therefore did not install the C++ compiler. By attempting to manually create a C++ project in the Visual Studio 2015 GUI I was able to prompt it to download the C++ packages. Cmake was then able to find the compiler without any difficulty.

这篇关于CMake找不到Visual C ++编译器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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