{
  "id": "go/cgo-undefined-symbol",
  "signature": "undefined symbol: some_function",
  "signature_zh": "未定义符号：some_function",
  "regex": "undefined\\ symbol:\\ some_function",
  "domain": "go",
  "category": "build_error",
  "subcategory": null,
  "root_cause": "C function declared in Go with `// #include` but not linked or defined in any linked library.",
  "root_cause_type": "generic",
  "root_cause_zh": "在Go中通过`// #include`声明了C函数，但该函数在链接的库中未定义或未链接。",
  "versions": [
    {
      "version": "1.21",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "1.22",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "Adding `// #cgo LDFLAGS: -lfoo` without verifying library path",
      "why_fails": "Library may be in non-standard location or misspelled.",
      "fail_rate": 0.6,
      "condition": "",
      "sources": []
    },
    {
      "action": "Reordering C code in the same file",
      "why_fails": "Does not resolve missing external symbol.",
      "fail_rate": 0.9,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Explicitly link the correct library with full path",
      "success_rate": 0.85,
      "how": "// #cgo LDFLAGS: -L/usr/local/lib -lfoo\n// #include <foo.h>\nimport \"C\"",
      "condition": "",
      "sources": []
    },
    {
      "action": "Define the missing function in a C source file and compile together",
      "success_rate": 0.75,
      "how": "Create a .c file next to Go code, then `go build` will compile it.",
      "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.85,
  "fix_success_rate": 0.8,
  "resolvable": "true",
  "first_seen": "2024-02-10",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}