I am building a C++ dll that will be consumed by C & C++ applications. I understand that /MT will cause the static library (LIBCPMT.LIB) code to be dumped into my dll, hence no dependency. /MD will link to import library and will have a dependency on the C++ runtime (MSVCP100.dll).
My doubts:
In /MD option do I have to make sure the right version of the C++ runtime dll, the one's import library I had linked to during development, exists on Windows OS?
Do I need to care about what C/C++ runtime the applications using my dll were linked to ? I want to use the C++11 features but want to make sure old C++ applications can still consume my dll.
I am planning to use VS 2012 RC now and I think their C++ runtime libraries got updated. Will there be any dependency again on what version of Windows that code will execute on or what libraries the applications consuming my dll used?
yes, the relevant runtime library DLL(s) must be present
yes, client code generally needs to use the same runtime. however you can work around that by offering only a C style interface, or a COM interface, to clients. e.g., no std::string
or other data that contains things allocated by the runtime.
yes, you'll be limited to the supported target platforms for VS 2012—Windows Vista and later.