cmake
link_error
ai_generated
true
Runtime error: shared library not found after install
ID: cmake/install-rpath-error
80%Fix Rate
84%Confidence
3Evidence
2023-01-01First Seen
Version Compatibility
| Version | Status | Introduced | Deprecated | Notes |
|---|---|---|---|---|
| 3 | active | — | — | — |
Root Cause
Installed binary cant find shared libraries at runtime.
genericWorkarounds
-
90% success Set CMAKE_INSTALL_RPATH: set(CMAKE_INSTALL_RPATH "/../lib")
-
85% success Enable CMAKE_INSTALL_RPATH_USE_LINK_RPATH for build-tree rpaths
Dead Ends
Common approaches that don't work:
-
Set LD_LIBRARY_PATH globally
75% fail
Not portable, fragile
-
Use -Wl,-rpath with absolute paths
72% fail
Breaks on different install prefix