title: Use C++ DLLs from the same VS compiled at different times/teams - ABI compatibility?
body: <p><strong>To repeat: I'm looking for ABI compatibility between libraries of <em>the same</em> Visual-C++ version!</strong></p>
  
  <p>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.</p>
  
  <p>When consuming C++ DLLs <em>with C++ interfaces</em> it is <a href="https://stackoverflow.com/questions/331045/using-c-dlls-with-different-compiler-versions">rather</a> <a href="https://stackoverflow.com/questions/9233118/library-abi-compatibility-between-versions-of-visual-studio">clear</a> <a href="https://stackoverflow.com/questions/232926/how-to-make-consistent-dll-binaries-across-vs-versions">that</a> you only can do this if all DLLs are compiled with the same compiler / Visual Studio version.</p>
  
  <p>What is not readily apparent to me is <em>what</em>, exactly needs to be the same to get ABI compatibility.</p>
  
  <ul>
  <li><em>Obviously</em> debug (<code>_DEBUG</code>) and release (<code>NDEBUG</code>) cannot be mixed -- but that's also apparent from the fact that these link to different versions of the shared runtime.</li>
  <li>Do you need the exact same <em>compiler</em> version, or is it sufficient that the resulting DLL links to the same <em>shared</em> C++ runtime -- that is, basically to the same <a href="https://www.microsoft.com/en-us/download/details.aspx?id=48145" rel="nofollow noreferrer">redistributable</a>? (I think static doesn't fly when passing full C++ objects around)</li>
  <li>Is there a documented list of <a href="https://msdn.microsoft.com/en-us/library/fwkeyyhe.aspx?" rel="nofollow noreferrer">compiler</a> (and linker) options that need to be the same for two C++ DLLs of the same vc++ version to be compatible?
  
  <ul>
  <li>For example, is the same <code>/O</code> switch necessary - does the optimization level affect ABI compatibility´? (I'm pretty sure not.)</li>
  <li>Or do both version have to use the same <a href="https://msdn.microsoft.com/en-us/library/1deeycx5.aspx?" rel="nofollow noreferrer"><code>/EH</code> switch</a>?</li>
  <li>Or <a href="https://msdn.microsoft.com/en-us/library/12a04hfd.aspx?" rel="nofollow noreferrer"><code>/volatile:ms|iso</code></a> ... ?</li>
  </ul></li>
  </ul>
  
  <p><strong>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.</strong></p>
  
  <p>If differences exist, my focus is on VS2015 only at the moment.</p>