title: Multiple Project Configurations C++
body: <p>I use Visual Studio 2017 (but applies to any version from 2010+) and I've been trying to come up with a way to organize my Debug/Release libraries in such a way as to avoid all these linking errors we get, when mixing different versions of the Runtime libraries.  My goal seems simple, conceptually, but I have not yet figured out a way to achieve all I want.</p>
  
  <p>Here's what I have, and what I'd like to do:</p>
  
  <hr>
  
  <p>Common Libraries:<br>
    ComLib1<br>
    ComLib2<br>
    ...  </p>
  
  <hr>
  
  <p>Exe1:<br>
    ComLib1<br>
    ComLib2<br>
    ...<br>
    Exe1Lib1<br>
    Exe1Lib2<br>
    ...<br>
    Exe1  </p>
  
  <hr>
  
  <p>Exe2:<br>
    ComLib1<br>
    ComLib2<br>
    ...<br>
    Exe2Lib1<br>
    Exe2Lib2<br>
    ...<br>
    Exe2  </p>
  
  <hr>
  
  <p>So 2 different executable, using a set of common libraries and Exe-specific libraries.</p>
  
  <p>I want to create 4 different build configurations.  </p>
  
  <p>Cfg1:<br>
  This would contain debugging info/non-optimized code for all libraries, including the Common Libraries.  </p>
  
  <p>Cfg2:<br>
  This would contain debugging info/non-optimized code for all Exe-specific libraries, but NOT for the Common Libraries.  </p>
  
  <p>Cfg3:<br>
  This would contain a combination of debugging info/non-optimized code libraries for some libraries, and non-debugging info/optimized libraries for the remaining ones.  </p>
  
  <p>Cfg4:<br>
  You guessed it. This would contain non-debugging info and optimized code for all.  </p>
  
  <p>My first attempt was to basically create 2 sets of binaries for each library; one compiled in Debug Mode (with /MTd /Od) and another one compiled in Release Mode with (/MT /O2). Then pick one or the other version in my various configurations. This was fine for Cfg1 &amp; Cfg4 (since all Runtime libraries are consistent throughout), but ran into those those linking errors for Cfg2 &amp; Cfg3. </p>
  
  <p>I understand why I get these errors. I'm just not sure how one goes about resolving these things, in what I would think would be a common scenario.  Maybe Cfg3 is uncommon, but I would think Cfg1,2 &amp; 4 are.  </p>
  
  <p>Thanks for your inputs.</p>
  
  <hr>
  
  <p>EDIT<br>
  I didn't really think I needed to add this information because I wanted to keep my question short(er). But if it can help clarify my goal, I'll add this up. </p>
  
  <p>This is for a Realtime simulator. I just can't run every single library in a typical Debug configuration, as I would not be able to maintain Realtime.  I seldom need to Debug the Common Libraries because they're mostly related to Server/IO tasks.  The Exe libs mostly contain math/thermodynamics and is where I mostly spend my time.  However, 1 Exe lib contains reactor neutronics, which involved heavy calculations. We typically treat that one as a black-box (cryptic vendor-provided code) and I almost always want to run it using Optimized code (typical Release settings).</p>