gpt4 book ai didi

c++ - CMake 找不到 Visual C++ 编译器

转载 作者:IT老高 更新时间:2023-10-28 11:53:13 31 4
gpt4 key购买 nike

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

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.

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

如何设置 CMake 以使用 Visual Studio 2015 在 Windows 上工作?

最佳答案

我找到了解决方案。虽然 Visual Studio IDE 安装成功,但它没有安装任何构建工具,因此没有安装 C++ 编译器。

通过尝试手动 create a C++ project in the Visual Studio 2015 GUI我能够提示它下载 C++ 包。然后 CMake 可以毫无困难地找到编译器。

关于c++ - CMake 找不到 Visual C++ 编译器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31619296/

31 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com