title: How to deploy only a single executable file
body: <p>MSVC++ provides an optimization for programmers that want to deploy only a single executable file. You can build with /MT to link the C++ runtime library and the standard C++ library into the EXE; or /MD to call C++ runtime libraries (.DLL files).</p>
  
  <p>But for your own code, or third party DLLs, is it possible to generate only a single executable file?</p>
  
  <p>Suppose project <code>PrjA</code> uses <code>PrjB</code>; now, <code>PrjB</code> only generates dynamic library <code>PrjB.dll</code>, not static library <code>PrjB.lib</code>. It there a way to configure them so that <code>PrjA</code> could generate <code>PrjA.exe</code>, which embedded <code>PrjB.dll</code> inside, so that only 1 file need be deployed? </p>
  
  <p>Note: the constraint iss that only <code>PrjB.DLL</code> is provided, no static library <code>prjB.LIB</code>. This question is different from <a href="https://stackoverflow.com/questions/811720/c-how-to-compile-dll-in-a-exe">C++ How to compile dll in a .exe</a> .</p>
  
  <p><a href="https://msdn.microsoft.com/en-us/library/2kzt1wy3.aspx" rel="nofollow noreferrer">MSVC /MD, /MT config using C++ Runtime Library</a>: </p>
  
  <ul>
  <li><p>/MD  Causes the application to use the multithread-specific and
  DLL-specific version of the run-time library. </p></li>
  <li><p>/MT  Causes the application to use the multithread, static version of the run-time library. </p></li>
  </ul>