MSVC++ provides an optimization for programmers that want to deploy only a single executable file. You can build with /MT to link the C++ runtime library and the standard C++ library into the EXE; or /MD to call C++ runtime libraries (.DLL files).
But for your own code, or third party DLLs, is it possible to generate only a single executable file?
Suppose project PrjA
uses PrjB
; now, PrjB
only generates dynamic library PrjB.dll
, not static library PrjB.lib
. It there a way to configure them so that PrjA
could generate PrjA.exe
, which embedded PrjB.dll
inside, so that only 1 file need be deployed?
Note: the constraint iss that only PrjB.DLL
is provided, no static library prjB.LIB
. This question is different from C++ How to compile dll in a .exe .
MSVC /MD, /MT config using C++ Runtime Library:
/MD Causes the application to use the multithread-specific and DLL-specific version of the run-time library.
/MT Causes the application to use the multithread, static version of the run-time library.