title: Combine Debug with Release for C++ .lib in Visual Studio
body: <p>I'm trying to make my C++ into a .lib file to use with my projects.</p>
  
  <p>I have the files <code>Log.h</code> and <code>Log.cpp</code>.</p>
  
  <p>I went into my project properties in Visual Studio and changed the configuration type from <code>.exe</code> to <code>.lib</code>. I set the build mode to <code>Release</code> and built my class into a file called <code>Log.lib</code>.</p>
  
  <p>In a new C++ project, I'm trying to include that <code>.lib</code> file I made along with the <code>Log.h</code> file. All was successful, it recognised my functions, but when I try to run my exe program with my included <code>Log.h</code>, I get the following errors:</p>
  
  <pre><code>mismatch detected for '_ITERATOR_DEBUG_LEVEL':
      value '2' doesn't match value '0' in main.obj
  </code></pre>
  
  <p>By referencing <a href="https://stackoverflow.com/questions/7668200">this</a> stackoverflow post, I discovered that building and running my new project in <code>Release</code> mode (the same as the <code>.lib</code> mode) removes the errors and I can successfully run my program and use the <code>Log.h</code>.</p>
  
  <p>How can I compile my <code>Log.h</code> lib to be compatible with both <code>Debug</code> and <code>Release</code>?</p>