Microsoft Visual C++ 6.0 各类工程配置说明(二)

(4.2) Use MFC in a Shared DLL
:与(4.1) 相比,增加了_WINDLL,_AFXDLL 的定
编译 参数:没有太大区
接参数:/nologo /dll /incremental:yes /pdb:"Debug/Win32DllDemo.pdb" /debug/machine:I386/out:"Debug/Win32DllDemo.dll" /implib:"Debug/Win32DllDemo.lib" /pdbtype:sept
可以看出,(4.1) 里
接的很多 消失了, 这时 目4 成了 似于 目2 中的 置。 需要注意, 目4 的stdafx.h 包含了<windows.h> ,此 如果要用MFC 的 ,需要自己加入MFC 的几个 文件(<afxwin.h> 、<afxext.h> 等),并且将#include <windows.h> 和DllMain 入口函数注 掉!
(4.3) Use MFC in a Static DLL
使用MFC DLL 的方式Shared 和Static 之
的区 与上述 似,不再做比
5.Win32 Static Library

预编译头 文件stdafx.h( 可能没有 个文件):
不使用MFC ,
仅仅 #define WIN32_LEAN_AND_MEAN ,而如果使用MFC ,内容如下:
#define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers
#include <afx.h>   #include <afxwin.h>
(5.1) Not Using MFC     
:WIN32,_DEBUG,_MBCS,_LIB ,新出 了符号_LIB
编译 参数:/nologo /MLd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /Fp"Debug/W32StaPrehead.pch" /Yu"stdafx.h" /Fo"Debug/" /Fd"Debug/" /FD /GZ    /c
注意到使用的Run-time library 参数
/MLd
参数: 目没有Link ,代替的是Library ,参数如下:/nologo /out:"Debug/W32StaPrehead.lib"
(5.2) Use MFC in a Shared DLL
:WIN32,_DEBUG,_WINDOWS,_MBCS,_AFXDLL ,与 目1 (MFC Exe ) 置相同。
编译 参数:注意使用的Run-time library 参数 /MDd
参数:没有太大区
(5.3) Use MFC in a Static DLL
编译 参数:注意使用的Run-time library 参数 /MTd
6.Win32 Application

预编译头 文件stdafx.h
#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
#include <windows.h> // Windows Header Files:

#include <stdlib.h> #include <malloc.h> #include <memory.h> #include <tchar.h> // C RunTime Header Files
了Win32 程序的入口函数WinMain 。
目,Project->settings->General 中 置使用MFC 的方式,一般 设为 Not Using MFC ,否 程序 构的改 大。从Not Using MFC 到使用MFC 的改 对连 接的 的影响 似于 目4 (Win32 DLL )。
(6.1) Not Using MFC
:WIN32,_DEBUG,_WINDOWS,_MBCS
编译 参数:/nologo /MLd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /Fp"Debug/W32StaPrehead.pch" /Yu"stdafx.h" /Fo"Debug/" /Fd"Debug/" /FD /GZ    /c
注意到使用的Run-time library 参数
/MLd
接参数:kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /incremental:yes /pdb:"Debug/W32AppDemo.pdb" /debug /machine:I386 /out:"Debug/W32AppDemo.exe" /pdbtype:sept
(6.2) Use MFC in a Shared DLL
编译 参数:注意使用的Run-time library 参数 /MDd
(6.3) Use MFC in a Static DLL
编译 参数:注意使用的Run-time library 参数 /MTd

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值