title: Compiling Visual c++ programs from the command line and msvcr90.dll
body: <p>When I compile my Visual c++ 2008 express program from inside the IDE and redistribute it on another computer, It starts up fine without any dll dependencies that I haven't accounted for. When I compile the same program from the visual c++ 2008 command line under the start menu and redistribute it to the other computer, it looks for msvcr90.dll at start-up. </p>
  
  <p>Here is how it is compiled from the command line</p>
  
  <p>cl /Fomain.obj /c main.cpp /nologo -O2 -DNDEBUG /MD /ID:(list of include directories)
  link /nologo /SUBSYSTEM:WINDOWS /ENTRY:mainCRTStartup /OUT:Build\myprogram.ex
  e /LIBPATH:D:\libs (list of libraries)</p>
  
  <p>and here is how the IDE builds it based on the relevant parts of the build log.</p>
  
  <pre><code> /O2 /Oi /GL /I clude" /I (list of includes) /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D    "_UNICODE" /D "UNICODE" /FD /EHsc /MD /Gy /Yu"stdafx.h" /Fp"Release\myprogram" /Fo"Release\\" /Fd"Release\vc90.pdb" /W3 /c /Zi /TP /wd4250   /vd2
  
  Creating command line "cl.exe @d:\myprogram\Release\RSP00000118003188.rsp /nologo /errorReport:prompt"
  
  /OUT:"D:\myprgram\Release\myprgram.exe" /INCREMENTAL:NO /LIBPATH:"d:\gtkmm\lib" /MANIFEST /MANIFESTFILE:"Release\myprogam.exe.intermediate.manifest" /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /DEBUG /PDB:"d:\myprogram\Release\myprogram.pdb" /SUBSYSTEM:WINDOWS /OPT:REF /OPT:ICF /LTCG /ENTRY:"mainCRTStartup" /DYNAMICBASE /NXCOMPAT /MACHINE:X86 (list of libraries)
  
  Creating command line "link.exe @d:\myprogram\Release\RSP00000218003188.rsp /NOLOGO /ERRORREPORT:PROMPT"
  
  /outputresource:"..\Release\myprogram.exe;#1" /manifest
  
  .\Release\myprogram.exe.intermediate.manifest
  Creating command line "mt.exe @d:\myprogram\Release\RSP00000318003188.rsp /nologo"
  </code></pre>
  
  <p>I would like to be able to compile it from the command line and not have it look for such a late version of the runtime dll, like the version compiled from the IDE seems not to do. Both versions pass /MD to the compiler, so i am not sure what to do. </p>