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

来源:互联网 发布:淘宝怎么找人代付款 编辑:程序博客网 时间:2024/05/22 10:43
(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中的置。需要注意,4stdafx.h包含了<windows.h>,此如果要用MFC,需要自己加入MFC的几个文件(<afxwin.h><afxext.h>等),并且将#include <windows.h>DllMain入口函数注掉!
(4.3) Use MFC in a Static DLL
使用MFC DLL的方式SharedStatic
的区与上述似,不再做比
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,与1MFC 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的改对连接的的影响似于4Win32 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.libuser32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.libole32.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

原创粉丝点击