I've searched but didn't hit a meaningful explanation, like what's the effect, the mechanism, so I could understand it. An example for "meaningful explanation", there are quite some materials online explaining _DEBUG preprocessor, how turn it on will allow assert etc.
MSDN page #1 Building Settings for an MFC DLL for Visual Studio 6.0 says this is not for 1) Regular DLL, statically linked to MFCrequired, but required for 2) Regular DLL, using the shared MFC DLL, or, for 3) Extension DLL. But there's no further explanation.
MSDN page #2 AFXDLL Versions briefly mentioned:
Instead of building your application by statically linking to the MFC object-code libraries, you can build your application to use one of the AFXDLL libraries, which contain MFC in a DLL that multiple running applications can share. For a table of AFXDLL names, see DLLs: Naming Conventions.
Note: By default, the MFC Application Wizard creates an AFXDLL project. To use static linking of MFC code instead, set the Use MFC in a static library option in the MFC Application Wizard. Static linking is not available in the Standard Edition of Visual C++.
, but I'm even not sure if this AFXDLL is related to _AFXDLL preprocessor.
Stackoverflow post Unexplainable error "Please use the /MD switch for _AFXDLL builds" and #error Please use the /MD switch for _AFXDLL builds explained that /MT or /MTd conflict with _AFXDLL, but this is the same as the MSDN page #1, nothing new.
Could someone pls explain
- what does
_AFXDLLpreprocessor mean? the original motivation? - how does it affect the compiling or linking?
- is it obsolete?
- is
_AFXDLLpreprocessor related to theAFXDLLlibraries? and actually, what is this so called "AFXDLL library"?
_AFXDLLdefined by the compiler when you are compiling against an AFXDLL? Just so you can add target-dependent functionality. - Steeve_AFXDLLor not? - athos