fatal error C1189: #error: Please use the /MD switch for _AFXDLL builds
DLL从“Use MFC in a Shared DLL”改为“Use MFC in a Static Library”遇到了该问题。
检查Runtime Library设置:
Multi-threaded Debug (/MTd)
Multi-threaded (/MT)
正确。
那么问题出在哪里呢?
_AFXDLL 不能和静态链接MFC一起使用,所以去掉_AFXDLL或者_AFXEXT即可(_AFXDLL is never used with a static MFC build)。