The PR I linked has the flags you need. The challenge is that we want practically all extensions to dynamically link the C runtime (which always has shared state), and to statically link the C++ runtime (which mostly doesn’t). So typically the choice would be between /MT
and /MD
, but it’s not enough to get the hybrid arrangement. (You need to pass /MT
to the compiler to generate statically linked C++ code, then use linker arguments to remove the static CRT libs and replace them with the CRT import libs.)
The easiest way to check given a specific binary is to inspect the import table for msvcp*.dll
. And usually a text-like search of the file is going to be sufficient (IIRC it’s stored as UTF-16), but the PE structure isn’t too complicated to check it properly using the struct
module if you really want.