Skip to content

CMake 配置 Chrono 时报错:No CMAKE_C_COMPILER could be found #51

Description

@Allen6643
Image

我在 Windows 上用 CMake 配置 Chrono 源码时,点击 Configure 后立即报错,提示找不到 C 和 C++ 编译器。错误信息如下:

No CMAKE_C_COMPILER could be found.
No CMAKE_CXX_COMPILER could be found.
Error in configuration process, project files may be invalid.

环境信息

操作系统:Windows 10/11

Visual Studio 版本:Visual Studio Community 2022(版本号 17.14.19)

CMake 版本:4.3.3

Chrono 源码:从 GitHub 克隆(git clone --depth 1 --recursive)

复现步骤

打开 CMake GUI

设置源码目录为 D:/underwater/chrono

设置构建目录为 D:/underwater/chrono-build

点击 Configure,在弹出的窗口中选择 Visual Studio 17 2022,然后点击 Finish

报错立即出现,无法继续

我尝试过的解决方法

已在 Visual Studio Installer 中确认勾选了“使用 C++ 的桌面开发”工作负载

已确认 MSVC v143 - VS 2022 C++ x64/x86 生成工具 组件已安装

已尝试从“Developer Command Prompt for VS 2022”中启动 @donghaiwang

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions