# # pkg-config: exec: "pkg-config": executable file not found in $PATH

- **ID:** `go/missing-cgo-pkg-config`
- **Domain:** go
- **Category:** build_error
- **Verification:** ai_generated
- **Fix Rate:** 88%

## Root Cause

CGo packages requiring pkg-config for dependency resolution cannot find the pkg-config tool in the system PATH.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| Go 1.21 | active | — | — |
| Go 1.22 | active | — | — |
| pkg-config 0.29.2 | active | — | — |

## Workarounds

1. **Install pkg-config using the system package manager (e.g., apt-get install pkg-config on Debian/Ubuntu, brew install pkg-config on macOS)** (95% success)
   ```
   Install pkg-config using the system package manager (e.g., apt-get install pkg-config on Debian/Ubuntu, brew install pkg-config on macOS)
   ```
2. **Set PKG_CONFIG_PATH environment variable to point to custom pkg-config location if installed in non-standard path** (85% success)
   ```
   Set PKG_CONFIG_PATH environment variable to point to custom pkg-config location if installed in non-standard path
   ```

## Dead Ends

- **** — Many CGo packages are essential for system-level operations; disabling CGo breaks compilation. (95% fail)
- **** — Some packages cannot be compiled without CGo; this only works for pure Go packages. (60% fail)
