# undefined symbol: some_function

- **ID:** `go/cgo-undefined-symbol`
- **Domain:** go
- **Category:** build_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

C function declared in Go with `// #include` but not linked or defined in any linked library.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| 1.21 | active | — | — |
| 1.22 | active | — | — |

## Workarounds

1. **Explicitly link the correct library with full path** (85% success)
   ```
   // #cgo LDFLAGS: -L/usr/local/lib -lfoo
// #include <foo.h>
import "C"
   ```
2. **Define the missing function in a C source file and compile together** (75% success)
   ```
   Create a .c file next to Go code, then `go build` will compile it.
   ```

## Dead Ends

- **Adding `// #cgo LDFLAGS: -lfoo` without verifying library path** — Library may be in non-standard location or misspelled. (60% fail)
- **Reordering C code in the same file** — Does not resolve missing external symbol. (90% fail)
