Release版本编译选项:
nologo /ML /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /Fp"Release/Hello.pch" /YX /Fo"Release/" /Fd"Release/" /FD /c
最小化编译选项:
/nologo /Zp1 /MD /W4 /GX /O1 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /Fp"Release/HelloWorld.pch" /YX /Fo"Release/" /Fd"Release/" /FD /c
Release版本连接选项:
kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib 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:console
/incremental:no /pdb:"Release/Hello.pdb" /machine:I386 /out:"Release/Hello.exe"
最小化连接选项:
user32.lib MSVCRT.LIB /nologo /entry:"main" /subsystem:console /incremental:no /pdb:"Release/HelloWorld.pdb" /machine:I386 /nodefaultlib
/out:"Release/HelloWorld.exe" /opt:nowin98 /align:4 /merge:.rdata=.text /merge:.data=.text
注:
另外,如果要是用到MFC函数的程序,可在"Project(工程)--->settings(设置)"里面的"通用(General)"选项卡中在"Microsoft Foundation Classes"中选择使用一个MFC的dll(Use MFC in a Share Dll)也会使文件大小缩小很多