title: Running C++ binaries without the runtime redistributable (Server2k3, XPSP3)
body: <p>Having written a CGI application in Visual Studio 2008 and debigged it locally, I uploaded it to a Windows Server 2003 OS where it promptly failed to run.</p>
  
  <p>I am guessing I need to install the wretched Runtime distributable, but after reading this:</p>
  
  <p><a href="http://kobyk.wordpress.com/2007/07/20/dynamically-linking-with-msvcrtdll-using-visual-c-2005/" rel="noreferrer">http://kobyk.wordpress.com/2007/07/20/dynamically-linking-with-msvcrtdll-using-visual-c-2005/</a></p>
  
  <p>I am wondering if it makes more sense to ignore this side by side stuff and just re-write the app.</p>
  
  <p>I am guessing Windows Server 2003 does not have MSCRVT version I need?
  Does Windows Server 2003 have it?</p>
  
  <p>When it comes to deploying thick clients, I would like to distribute the required dlls with my app. 
  What are they assuming I just INCLUDE iostream, sstream, string?</p>
  
  <p>Does it change significantly if I add windows.h?</p>
  
  <p>Added:</p>
  
  <p>Using the /MT switch recommended below </p>
  
  <p>C / C++ -> Code Generation -> Runtime Library -> Multi-threaded(/MT)</p>
  
  <p>(You will probably need to do a clean:</p>
  
  <p>Build -> Clean</p>
  
  <p>in order to avoid the error message</p>
  
  <p>"Failed to save the updated manifest to the file")</p>
  
  <p>bloated my app from 38k to 573k. Thats what I call Significant (imagine if that were your salary). Since many instances of this app will be loaded and unloaded constantly (requiring precious memory and processor resources) I would like to find a better (smaller) solution.</p>
  
  <p>I understand this is not important for many situations today and not the focus of many developers, hence the trend to .NOT and 60MB runtimes, but this is what I want to do.</p>
  
  <p>Added:</p>
  
  <p>After removing the debugging to get the project to compile:</p>
  
  <p>Project -> Propeties -> c/c++ -> Preprocessor -> Preprocessor Definitions (remove DEBUG;)</p>
  
  <p>the size was reduced to 300k, and it will run. </p>
  
  <p>Added:
  As suggested by Chris Becke below, copying:
  msvcm90.dll
  msvcp90.dll
  msvcr90.dll
  Microsoft.VC90.CRT.manifest
  To the directory of the application will provide all the runtime needed.</p>
  
  <p>Using Visual Studio 6 has been suggested a few times, but it does not support Vista (or Windows 7 we assume) Other solutions that do not require a runtime distributable would probably me MASM or even a flavor of Basic. Unfortunately that defeats the purpose of using a high level OOP language like C++.</p>
  
  <p>So long as I do need to require the C++ redistributable be installed, the trade off is an additional 260k. Thats acceptable</p>