To repeat: I'm looking for ABI compatibility between libraries of the same Visual-C++ version!
We want to mix and match some internal C++ DLLs from different teams - built at different times with different project files. Because of long build times, we exactly want to avoid large monolithic builds where each team re-compiles the source code of another team's library.
When consuming C++ DLLs with C++ interfaces it is rather clear that you only can do this if all DLLs are compiled with the same compiler / Visual Studio version.
What is not readily apparent to me is what, exactly needs to be the same to get ABI compatibility.
- Obviously debug (
_DEBUG
) and release (NDEBUG
) cannot be mixed -- but that's also apparent from the fact that these link to different versions of the shared runtime. - Do you need the exact same compiler version, or is it sufficient that the resulting DLL links to the same shared C++ runtime -- that is, basically to the same redistributable? (I think static doesn't fly when passing full C++ objects around)
- Is there a documented list of compiler (and linker) options that need to be the same for two C++ DLLs of the same vc++ version to be compatible?
- For example, is the same
/O
switch necessary - does the optimization level affect ABI compatibility´? (I'm pretty sure not.) - Or do both version have to use the same
/EH
switch? - Or
/volatile:ms|iso
... ?
- For example, is the same
Essentially, I'd like to come up with a set of (meta-)data to associate with a Visual-C++ DLL that describes it's ABI compatibility.
If differences exist, my focus is on VS2015 only at the moment.
_ITERATOR_DEBUG_LEVEL
is also a thing that must be equal , since it influences the std-lib object layout. – Epicedium