{
  "id": "go/cgo-ldflags-ordering",
  "signature": "error: undefined reference to `some_function'",
  "signature_zh": "错误：对`some_function'的未定义引用",
  "regex": "error:\\ undefined\\ reference\\ to\\ `some_function'",
  "domain": "go",
  "category": "build_error",
  "subcategory": null,
  "root_cause": "Library order in `LDFLAGS` matters; if a library depends on another, it must come after.",
  "root_cause_type": "generic",
  "root_cause_zh": "`LDFLAGS`中的库顺序很重要；如果一个库依赖于另一个库，它必须放在后面。",
  "versions": [
    {
      "version": "1.18",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "1.19",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "Adding `-lfoo` multiple times",
      "why_fails": "Does not fix dependency order.",
      "fail_rate": 0.6,
      "condition": "",
      "sources": []
    },
    {
      "action": "Using `-Wl,--start-group ... --end-group` incorrectly",
      "why_fails": "May cause circular dependency issues.",
      "fail_rate": 0.4,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Order libraries so that dependencies come after dependents",
      "success_rate": 0.9,
      "how": "// #cgo LDFLAGS: -lbar -lfoo  // if foo depends on bar",
      "condition": "",
      "sources": []
    },
    {
      "action": "Use `-Wl,--as-needed` to allow reordering",
      "success_rate": 0.8,
      "how": "// #cgo LDFLAGS: -Wl,--as-needed -lfoo -lbar",
      "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": "2024-10-01",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}