{
  "id": "cmake/check-cxx-source-compiles-failed",
  "signature": "CMake Error: check_cxx_source_compiles failed with: <compiler error output>",
  "signature_zh": "CMake 错误：check_cxx_source_compiles 失败，错误信息：<编译器错误输出>",
  "regex": "CMake Error: check_cxx_source_compiles failed with:.*",
  "domain": "cmake",
  "category": "build_error",
  "subcategory": null,
  "root_cause": "A C++ source snippet provided to check_cxx_source_compiles() fails to compile, often due to missing headers, incorrect syntax, or incompatible compiler flags.",
  "root_cause_type": "generic",
  "root_cause_zh": "提供给 check_cxx_source_compiles() 的 C++ 源代码片段编译失败，通常是由于缺少头文件、语法错误或编译器标志不兼容。",
  "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.22",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "CMake 3.27",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "Adding -Werror or other flags globally to suppress warnings, hoping the snippet compiles",
      "why_fails": "The error is usually a hard compile failure, not a warning. Adding flags may introduce more issues.",
      "fail_rate": 0.9,
      "condition": "",
      "sources": []
    },
    {
      "action": "Removing the check entirely, assuming the feature is available",
      "why_fails": "The check is there for a reason; removing it may lead to runtime errors or build failures later.",
      "fail_rate": 0.85,
      "condition": "",
      "sources": []
    },
    {
      "action": "Copying the exact snippet into a standalone file and compiling it manually, then ignoring the CMake error",
      "why_fails": "Even if it compiles manually, the CMake check may have different include paths or flags; manual success does not guarantee CMake success.",
      "fail_rate": 0.7,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Inspect the compiler error output to identify missing headers or syntax issues, then fix the source snippet or add required include directories.",
      "success_rate": 0.85,
      "how": "Inspect the compiler error output to identify missing headers or syntax issues, then fix the source snippet or add required include directories.",
      "condition": "",
      "sources": []
    },
    {
      "action": "Set CMAKE_REQUIRED_FLAGS or CMAKE_REQUIRED_LIBRARIES to match the project's compile environment.",
      "success_rate": 0.8,
      "how": "Set CMAKE_REQUIRED_FLAGS or CMAKE_REQUIRED_LIBRARIES to match the project's compile environment.",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "Inspect the compiler error output to identify missing headers or syntax issues, then fix the source snippet or add required include directories.",
    "Set CMAKE_REQUIRED_FLAGS or CMAKE_REQUIRED_LIBRARIES to match the project's compile environment."
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://cmake.org/cmake/help/latest/module/CheckCXXSourceCompiles.html",
  "official_doc_section": null,
  "error_code": null,
  "verification_tier": "ai_generated",
  "confidence": 0.83,
  "fix_success_rate": 0.8,
  "resolvable": "partial",
  "first_seen": "2023-04-18",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}