{
  "id": "cmake/glfw3-not-found-missing-config",
  "signature": "CMake Error: Could NOT find GLFW3 (missing: GLFW3_DIR)",
  "signature_zh": "CMake 错误：找不到 GLFW3（缺少：GLFW3_DIR）",
  "regex": "CMake Error: Could NOT find GLFW3 \\(missing: GLFW3_DIR\\)",
  "domain": "cmake",
  "category": "config_error",
  "subcategory": null,
  "root_cause": "CMake's find_package(GLFW3) cannot locate the GLFW3Config.cmake or glfw3-config.cmake file, typically because GLFW3 is not installed or the install prefix is not in CMake's search path.",
  "root_cause_type": "generic",
  "root_cause_zh": "CMake 的 find_package(GLFW3) 无法找到 GLFW3Config.cmake 或 glfw3-config.cmake 文件，通常是因为 GLFW3 未安装或安装前缀不在 CMake 搜索路径中。",
  "versions": [
    {
      "version": "GLFW 3.3",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "GLFW 3.4",
      "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"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "Some system packages (e.g., libglfw3 on Ubuntu) install only the shared library and headers, not the CMake config file. The config file is in a separate -dev package.",
      "fail_rate": 0.7,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "GLFW3_DIR must point to the directory containing GLFW3Config.cmake, typically the build or install directory, not the source root.",
      "fail_rate": 0.85,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Without REQUIRED, CMake continues but variables like GLFW3_FOUND are FALSE, leading to undefined symbols at link time.",
      "fail_rate": 0.6,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Install the development package: On Ubuntu/Debian: sudo apt-get install libglfw3-dev. On Fedora: sudo dnf install glfw-devel. On macOS: brew install glfw.",
      "success_rate": 0.9,
      "how": "Install the development package: On Ubuntu/Debian: sudo apt-get install libglfw3-dev. On Fedora: sudo dnf install glfw-devel. On macOS: brew install glfw.",
      "condition": "",
      "sources": []
    },
    {
      "action": "If building GLFW3 from source, run cmake with -DGLFW_BUILD_DOCS=OFF -DGLFW_INSTALL=ON and then sudo make install. Then set GLFW3_DIR to the install prefix (e.g., /usr/local/lib/cmake/glfw3).",
      "success_rate": 0.85,
      "how": "If building GLFW3 from source, run cmake with -DGLFW_BUILD_DOCS=OFF -DGLFW_INSTALL=ON and then sudo make install. Then set GLFW3_DIR to the install prefix (e.g., /usr/local/lib/cmake/glfw3).",
      "condition": "",
      "sources": []
    },
    {
      "action": "Provide GLFW3_DIR manually on command line: cmake .. -DGLFW3_DIR=/path/to/glfw3/lib/cmake/glfw3",
      "success_rate": 0.8,
      "how": "Provide GLFW3_DIR manually on command line: cmake .. -DGLFW3_DIR=/path/to/glfw3/lib/cmake/glfw3",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "安装开发包：在 Ubuntu/Debian 上：sudo apt-get install libglfw3-dev。在 Fedora 上：sudo dnf install glfw-devel。在 macOS 上：brew install glfw。",
    "如果从源码构建 GLFW3，运行 cmake 时加上 -DGLFW_BUILD_DOCS=OFF -DGLFW_INSTALL=ON，然后 sudo make install。然后将 GLFW3_DIR 设置为安装前缀（例如 /usr/local/lib/cmake/glfw3）。",
    "在命令行手动提供 GLFW3_DIR：cmake .. -DGLFW3_DIR=/path/to/glfw3/lib/cmake/glfw3"
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://www.glfw.org/docs/latest/build.html",
  "official_doc_section": null,
  "error_code": null,
  "verification_tier": "ai_generated",
  "confidence": 0.85,
  "fix_success_rate": 0.85,
  "resolvable": "true",
  "first_seen": "2023-03-01",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}