Given a compiled lib, is there a way to tell if it was compiled with /md or /mt just by looking at it (maybe with dumpbin
Yes, you could use dumpbin's /DIRECTIVES option to find which runtime libraries the objects in the .lib want to link with:
dumpbin /directives foo.lib
Look for instances of the runtime libraries specified here. For example, you might see:
/DEFAULTLIB:MSVCRTD (module compiled with /MDd)
or
/DEFAULTLIB:MSVCRT (module compiled with /MD)
or
/DEFAULTLIB:LIBCMT (module compiled with /MT)
There will probably be many /DEFAULTLIB directives, so you can search using terms like:
dumpbin /DIRECTIVES foo.lib | find /i "msvcr"
Hope this gets you on the right track.