error C1189: #error : Please use the /MD switch for _AFXDLL builds---解决方案

来源:互联网 发布:usb数据采集模块 编辑:程序博客网 时间:2024/06/04 20:04

网上搜到的一般的方法都是说将”属性页->配置属性->C/C++->代码生成->运行库” 由 “多线程(/MT)” 改为 “多线程DLL(/MD)”。
其中MT静态编译的选项,而MD是动态编译的选项,如果就是想静态编译呢?

其实,在将”运行库”设置为MT的同时,再将”属性页->配置属性->常规->MFC的使用”改为”在静态库中使用MFC”
即可。
IntelliSense: error 指令: Please use the /MD switch for _AFXDLL builds —-解决方法 - ordinarydiligent - ZhangSir的博客

IntelliSense: error 指令: Please use the /MD switch for _AFXDLL builds —-解决方法 - ordinarydiligent - ZhangSir的博客

同样的道理,想要动态编译时,对于:
错误 1 error C1189: #error : Building MFC application with /MD[d] (CRT dll version) requires MFC shared dll version. Please #define _AFXDLL or do not use /MD[d]

需要将”属性页->配置属性->常规->MFC的使用”设置为”在共享DLL中使用MFC”,同时将”属性页->配置属性->C/C++->代码生成->运行库”设置为”多线程DLL(/MD)”

补充:(/MD)和(/MT)是编译Release版本用的,(/MDd)和(/MTd)是编译Debug版本用的




原文地址:http://blog.csdn.net/matitie2012/article/details/47293843

0 0