cmake
config_error
ai_generated
true
CMake Error: cannot use STATIC and SHARED library together
ID: cmake/static-shared-conflict
82%Fix Rate
86%Confidence
3Evidence
2023-01-01First Seen
Version Compatibility
| Version | Status | Introduced | Deprecated | Notes |
|---|---|---|---|---|
| 3 | active | — | — | — |
Root Cause
Mixing static and shared library types causing issues.
genericWorkarounds
-
88% success Build both: add_library(foo STATIC) and add_library(foo_shared SHARED)
-
90% success Use BUILD_SHARED_LIBS option to let user choose
Dead Ends
Common approaches that don't work:
-
Make everything STATIC
68% fail
Large binary, no shared benefits
-
Make everything SHARED
65% fail
Deployment complexity