title: Linking Static Library with Dynamic Library Error : LNK2038 Mismatch detected
body: <p>I am new to the Windows environment and I am trying to build a DLL project in Visual Studio 2015 Update 3. The DLL project depends on some libraries, DLLs as well as static (BeJsonCpp.lib)</p>
  
  <p>When I try to compile the project, I get the </p>
  
  <blockquote>
    <p>LNK2038</p>
  </blockquote>
  
  <p>The description is as follows</p>
  
  <pre><code>mismatch detected for 'RuntimeLibrary': value 'MD_DynamicRelease' dosen't match value 'MDd_DynamicDebug' in .obj
  </code></pre>
  
  <p>I tried to compile the project with /MD (MD_DynamicRelease) Code Generation Option, as well as with /MDd (MDd_DynamicDebug) option, but the error persists.</p>
  
  <p>If I change the project configuration type from Dynamic Library (.dll) to Static Library (.lib) I could compile and link the project successfully without any errors. But compiling it as a Dynamic Library throws the above error.</p>
  
  <p>What I think is that BeJsonCpp is built for static environment and hence it is showing this behavior.</p>
  
  <p>I want the output to be DLL.</p>
  
  <p>I do not have the source of BeJsonCpp Library.</p>