{
  "id": "cmake/generator-ninja-missing-compiler",
  "signature": "CMake Error: The Ninja generator does not support the CXX compiler 'clang++' because it is not a known compiler.",
  "signature_zh": "CMake 错误：Ninja 生成器不支持 CXX 编译器 'clang++'，因为它不是已知的编译器。",
  "regex": "CMake Error: The Ninja generator does not support the CXX compiler '[^']+' because it is not a known compiler",
  "domain": "cmake",
  "category": "build_error",
  "subcategory": null,
  "root_cause": "CMake's Ninja generator has a hardcoded list of supported compilers; if the compiler is not in that list (e.g., a custom build of clang or a different version), CMake rejects it.",
  "root_cause_type": "generic",
  "root_cause_zh": "CMake 的 Ninja 生成器有一个硬编码的支持编译器列表；如果编译器不在该列表中（例如自定义构建的 clang 或不同版本），CMake 会拒绝它。",
  "versions": [
    {
      "version": "CMake 3.10",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "CMake 3.16",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "CMake 3.20",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "Ninja 1.10",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "Ninja 1.11",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "If the project requires clang-specific features (e.g., libc++), using g++ may cause compilation errors.",
      "fail_rate": 0.6,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "The issue is not version-specific; CMake's Ninja generator has a whitelist of compiler IDs. Even standard clang may fail if CMake version is old.",
      "fail_rate": 0.7,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "This works but may not preserve Ninja's build speed; also, the project may have Ninja-specific custom commands.",
      "fail_rate": 0.3,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Use the 'Unix Makefiles' generator instead: cmake -G \"Unix Makefiles\" ..",
      "success_rate": 0.9,
      "how": "Use the 'Unix Makefiles' generator instead: cmake -G \"Unix Makefiles\" ..",
      "condition": "",
      "sources": []
    },
    {
      "action": "Set the CMAKE_GENERATOR to Ninja and also set CMAKE_CXX_COMPILER to a known compiler like g++: cmake -G Ninja -DCMAKE_CXX_COMPILER=g++ ..",
      "success_rate": 0.8,
      "how": "Set the CMAKE_GENERATOR to Ninja and also set CMAKE_CXX_COMPILER to a known compiler like g++: cmake -G Ninja -DCMAKE_CXX_COMPILER=g++ ..",
      "condition": "",
      "sources": []
    },
    {
      "action": "Upgrade CMake to a version that supports your compiler. For example, CMake 3.20+ added support for newer clang versions. Check release notes.",
      "success_rate": 0.75,
      "how": "Upgrade CMake to a version that supports your compiler. For example, CMake 3.20+ added support for newer clang versions. Check release notes.",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "改用 'Unix Makefiles' 生成器：cmake -G \"Unix Makefiles\" ..",
    "设置 CMAKE_GENERATOR 为 Ninja 并设置 CMAKE_CXX_COMPILER 为已知编译器如 g++：cmake -G Ninja -DCMAKE_CXX_COMPILER=g++ ..",
    "升级 CMake 到支持你的编译器的版本。例如，CMake 3.20+ 增加了对更新 clang 版本的支持。检查发布说明。"
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://cmake.org/cmake/help/latest/generator/Ninja.html",
  "official_doc_section": null,
  "error_code": null,
  "verification_tier": "ai_generated",
  "confidence": 0.84,
  "fix_success_rate": 0.7,
  "resolvable": "partial",
  "first_seen": "2024-01-10",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}