Article ID: 140584
Article Last Modified on 7/1/2004
Reusable Library Switch Library Macro(s) Defined ---------------------------------------------------------------- Single Threaded /ML LIBC (none) Static MultiThread /MT LIBCMT _MT Dynamic Link (DLL) /MD MSVCRT _MT and _DLL Debug Single Threaded /MLd LIBCD _DEBUG Debug Static MultiThread /MTd LIBCMTD _DEBUG and _MT Debug Dynamic Link (DLL) /MDd MSVCRTD _DEBUG, _MT, and _DLLYou can view an object module to determine which switch was used when it was built by using this command:
dumpbin /all <object>.objLook in the section titled RAW DATA #1. In the right-most column, the default libraries will be listed.
// MyReusableStaticSingleThreadReleaseLibrary.h
#if defined(_MT) || defined(_DEBUG)
#error The /ML compiler switch is required.
#endif
// MyReusableStaticMultithreadReleaseLibrary.h
#if !defined(_MT) || defined(_DLL) || defined(_DEBUG)
#error The /MT compiler switch is required.
#endif
// MyReusableDynamicLinkReleaseLibrary.h
#if !defined(_MT) || !defined(_DLL) || defined(_DEBUG)
#error The /MD compiler switch is required.
#endif
// MyReusableStaticSingleThreadDebugLibrary.h
#if defined(_MT) || !defined(_DEBUG)
#error The /MLd compiler switch is required.
#endif
// MyReusableStaticMultithreadDebugLibrary.h
#if !defined(_MT) || defined(_DLL) || !defined(_DEBUG)
#error The /MTd compiler switch is required.
#endif
// MyReusableDynamicLinkDebugLibrary.h
#if !defined(_MT) || !defined(_DLL) || !defined(_DEBUG)
#error The /MDd compiler switch is required.
#endif
Keywords: kbhowto kbcrt KB140584