{
  "id": "go/cgo-dynamic-library-not-found",
  "signature": "error: cgo: dynamic library not found: libfoo.so: cannot open shared object file: No such file or directory",
  "signature_zh": "错误：cgo：未找到动态库：libfoo.so：无法打开共享对象文件：没有那个文件或目录",
  "regex": "error:\\ cgo:\\ dynamic\\ library\\ not\\ found:\\ libfoo\\.so:\\ cannot\\ open\\ shared\\ object\\ file:\\ No\\ such\\ file\\ or\\ directory",
  "domain": "go",
  "category": "build_error",
  "subcategory": null,
  "root_cause": "Dynamic library (`.so`) not in standard library paths or `LD_LIBRARY_PATH`.",
  "root_cause_type": "generic",
  "root_cause_zh": "动态库（`.so`）不在标准库路径或`LD_LIBRARY_PATH`中。",
  "versions": [
    {
      "version": "1.20",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "1.21",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "Copying .so to current directory",
      "why_fails": "Current directory not searched by default.",
      "fail_rate": 0.7,
      "condition": "",
      "sources": []
    },
    {
      "action": "Using `-rpath` without absolute path",
      "why_fails": "Relative rpath may break if binary moved.",
      "fail_rate": 0.5,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Set `LD_LIBRARY_PATH` before running",
      "success_rate": 0.9,
      "how": "export LD_LIBRARY_PATH=/path/to/lib:$LD_LIBRARY_PATH\n./program",
      "condition": "",
      "sources": []
    },
    {
      "action": "Use `-rpath` in LDFLAGS with absolute path",
      "success_rate": 0.85,
      "how": "// #cgo LDFLAGS: -rpath,/path/to/lib -L/path/to/lib -lfoo",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": null,
  "official_doc_section": null,
  "error_code": null,
  "verification_tier": "ai_generated",
  "confidence": 0.87,
  "fix_success_rate": 0.8,
  "resolvable": "true",
  "first_seen": "2025-02-14",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}