title: Console Application doesn't exit when compiled using Multi-Threaded (/MT) configuration
body: <p>I wrote the following code and used Visual Studio 2013 to build my .exe </p>
  
  <pre><code>#include &lt;windows.h&gt;   
  #include &lt;stdio.h&gt;   
  #include &lt;iostream&gt;   
  #include &lt;string&gt;   
  #include &lt;unistd.h&gt;   
  
  DWORD WINAPI reader(LPVOID lpParameter)
  {
      std::string str;
      std::cout &lt;&lt; "inside reader" &lt;&lt; std::endl;
      std::getline(std::cin, str);
      return 0;
  }
  
  int main()
  {
     HANDLE hThreadR;
     DWORD dwThreadId, dwThrdParam = 1;
     int threadStatus;
     bool terminateThreadStatus;
  
     hThreadR = CreateThread(NULL, 0, reader, 0, 0, &amp;dwThreadId);
     threadStatus = WaitForSingleObject(hThreadR, 10000);
     if (threadStatus == 258)
     {
          terminateThreadStatus = TerminateThread(hThreadR, 0);
          std::cout &lt;&lt; "terminateThreadStatus: " &lt;&lt; terminateThreadStatus &lt;&lt; std::endl;
     }
     return 0;
  }
  </code></pre>
  
  <p>The problem that I am facing is the following: </p>
  
  <p>If I build the .exe using the <code>Multi-Threaded DLL(/MD)
  (PROJECT-&gt;ConsoleApplication Property Pages-&gt;Configuration Properties-&gt;C/C++-&gt;Code Generation-&gt;Multi-Threaded DLL(/MD))</code> and there is nothing received in stdin after 10 secs, thread times out and is terminated and program closes. This is the desired behavior. </p>
  
  <p>If I build the .exe using the <code>Multi-Threaded (/MT)
  (PROJECT-&gt;ConsoleApplication Property Pages-&gt;Configuration Properties-&gt;C/C++-&gt;Code Generation-&gt;Multi-Threaded DLL(/MT))</code> and there is nothing received in stdin after 10 secs, thread times out and is terminated but program remains open.</p>
  
  <p>I wanted to build the .exe using Multi-Threaded (/MT) in order to avoid error...</p>
  
  <blockquote>
    <p>The program can't start because MSVCP120.dll is missing from your computer" when .exe runs to a computer that doesn't have the MSVCP120.dll.</p>
  </blockquote>
  
  <p>Any idea what causes the above described behavior?</p>