VC DLL编译参数区别

C的dll分win32 dll和MFC dll。MFC dll又分为使用共享MFC DLL的规则DLL,带静态链接MFC的规则DLL和MFC扩展DLL。
  
在工程建立以后,如何识别这些不同的DLL呢?
 
可以在工程属性 -> C++ -> 命令行看编译参数:
 
Win32 dll:
/Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_USRDLL" /D "WIN32DLL_EXPORTS" /D "_UNICODE" /D "UNICODE" /D "_WINDLL" /Gm /EHsc /RTC1 /MDd /Yu"stdafx.h" /Fp"Debug\Win32Dll.pch" /Fo"Debug\\" /Fd"Debug\vc90.pdb" /W3 /nologo /c /ZI /TP /errorReport:prompt
 
 
Shared Regular MFC dll:
/Od /D "WIN32" /D "_WINDOWS" /D "_DEBUG" /D "_USRDLL" /D "_WINDLL" /D "_UNICODE" /D "UNICODE" /D "_AFXDLL" /Gm /EHsc /RTC1 /MDd /Yu"stdafx.h" /Fp"Debug\ShareRegularMFCDll.pch" /Fo"Debug\\" /Fd"Debug\vc90.pdb" /W3 /nologo /c /ZI /TP /errorReport:prompt
 
 
Static Regular MFC dll:
/Od /D "WIN32" /D "_WINDOWS" /D "_DEBUG" /D "_USRDLL" /D "_WINDLL" /D "_UNICODE" /D "UNICODE" /Gm /EHsc /RTC1 /MTd /Yu"stdafx.h" /Fp"Debug\StaticRegularMFCDll.pch" /Fo"Debug\\" /Fd"Debug\vc90.pdb" /W3 /nologo /c /ZI /TP /errorReport:prompt
 
Extend MFC dll:
/Od /D "WIN32" /D "_WINDOWS" /D "_DEBUG" /D "_AFXEXT" /D "_WINDLL" /D "_UNICODE" /D "UNICODE" /D "_AFXDLL" /Gm /EHsc /RTC1 /MDd /Yu"stdafx.h" /Fp"Debug\ExtendMFCDll.pch" /Fo"Debug\\" /Fd"Debug\vc90.pdb" /W3 /nologo /c /ZI /TP /errorReport:prompt
 
 
MFC exe:
/Od /D "WIN32" /D "_WINDOWS" /D "_DEBUG" /D "_AFXDLL" /D "_UNICODE" /D "UNICODE" /Gm /EHsc /RTC1 /MDd /Yu"stdafx.h" /Fp"Debug\ResDllTest.pch" /Fo"Debug\\" /Fd"Debug\vc90.pdb" /W3 /nologo /c /ZI /TP /errorReport:prompt
 
dll都定义有_WINDLL
共享链接到MFC DLL的都有_AFXDLL
标准C导出dll都定义有_USRDLL
 
Win32 dll:                             _WINDLL    _USRDLL    XXX_EXPORTS (XXX为DLL名称) 
Shared Regular MFC dll:        _WINDLL    _USRDLL    _AFXDLL
Static Regular MFC dll:         _WINDLL    _USRDLL
Extend MFC dll                     _WINDLL    _AFXDLL    _AFXEXT
MFC exe:                              _AFXDLL
 
使用的区别请参考MSDN:
http://msdn.microsoft.com/zh-cn/library/vstudio/30c674tx(v=vs.100).aspx
http://msdn.microsoft.com/zh-cn/library/vstudio/f22wcbea(v=vs.100).aspx
http://msdn.microsoft.com/zh-cn/library/vstudio/h5f7ck28(v=vs.100).aspx
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值