Sometimes when you copy a program you wrote to another computer and run it, you get a prompt about a missing msxxxx.dll. This is because the target computer doesn’t have the corresponding version of the C++ runtime library installed.
At this point, you either install the C++ runtime library on the target computer, or change from dynamic compilation (without the runtime included) to static compilation (with the runtime included) at compile time. Also, dynamically compiled binaries are much smaller than statically compiled ones.
First, you must understand the relationship between the four options in Project -> Project Properties -> Configuration Properties -> C/C++ -> Code Generation -> Runtime Library:
| Display Name | Compile Option |
|---|---|
| Multi-threaded Debug DLL (/MDd) | MD_DynamicDebug |
| Multi-threaded DLL (/MD) | MD_DynamicRelease |
| Multi-threaded (/MT) | MD_StaticRelease |
| Multi-threaded (/MTd) | MD_StaticDebug |
There’s a detailed explanation in MSDN: http://msdn.microsoft.com/en-us/library/2kzt1wy3(VS.80).aspx
Those with a lowercase d (like /MDd, /MTd) are Debug mode. With a D is dynamic (/MD, /MDd), with a T is static (/MT, /MTd).