Does the one-STL-per-app recommendation always apply no matter what? #2238
sonicdebris
started this conversation in
General
Replies: 1 comment
-
|
Caveat emptor: I have never tried this. I think this can be made to work if you're extra careful about:
This might work, but also note the result might not be great for binary size; consumers of your library will wind up with a copy of a c++ runtime that can't be shared with other c++ applications. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I am integrating a pre-built library from a 3rd-party vendor, and I have the opportunity to shape some aspects of the dependency consumption with them.
The vendor's library uses the STL, and the guidelines advise to have both libraries (mine and the vendor's) link to the STL dynamically (ie. with
c++_shared), and making sure they link to "compatible" versions.While reviewing my options, I realised that, in terms of "compatibility peace of mind", it might be better to actually have each library link to the STL statically (
c++_static), provided that:Putting aside binary size considerations, this would free both us and the vendor from any effort in keeping the STL "aligned". Is my understanding correct? Is there anything I am missing in reasoning about this?
Beta Was this translation helpful? Give feedback.
All reactions