cmake
link_error
ai_generated
true
ld: cannot find -lfoo
ID: cmake/link-library-not-found
80%Fix Rate
84%Confidence
3Evidence
2023-01-01First Seen
Version Compatibility
| Version | Status | Introduced | Deprecated | Notes |
|---|---|---|---|---|
| 3 | active | — | — | — |
Root Cause
Linker cannot find required library.
genericWorkarounds
-
90% success Install library dev package with headers and .so symlink
-
88% success Use target_link_directories() or find_library() in CMakeLists.txt
Dead Ends
Common approaches that don't work:
-
Add -L to random library paths
75% fail
May find wrong library version
-
Copy .so file manually to /usr/lib
80% fail
Breaks package management