![]() |
中国DOS联盟-- 联合DOS 推动DOS 发展DOS --联盟域名:www.cn-dos.net 论坛域名:www.cn-dos.net/forum |
| 游客 | 登录 | 注册 | 会员 | 搜索 | 中国DOS联盟 |
|
中国DOS联盟论坛 现在时间是 2026-08-01 18:37 |
共 48,037 主题排行 / 350,122 发帖 / 今日 2 篇 / 48,249 会员排行 |
| DOS开发编程 & 发展交流 (开发室) » [编译问题]怎么djgpp编译出的程序那么大啊? |
| 可打印版本 1,995 / 6 |
| 第1楼 poor | 发表于 2006-12-24 11:33 |
| 初级用户 发帖 36 积分 160 | |
|
[编译问题]怎么djgpp编译出的程序那么大啊? [这回发在这里才对^_^]
我只不过写了个最最简单的hello程序,结果编译出来却有70老多K,近80K的样子, 而原来: 用TC2的才有8K(真tiny); 用LCCwin32编的win32 console程序才9k(很small); 用VC6编的console和gui程序,都是40k(大点也还凑合); 是我设的不对吗?即使再没优化,也不能那么大压。。。。 俺滴老天爷啊,俺么法活辣,这怎么瘦得撩蛙, 谁来帮俺解释解释压。。。。 一个hello的dos程序竟然80K,不敢相信哪。。。:( |
|
| 第2楼 electronixtar | 发表于 2006-12-29 08:01 |
| 铂金会员 发帖 2,672 积分 7,493 | |
|
给你个提示:
|
|
| 第3楼 poor | 发表于 2006-12-30 16:17 |
| 初级用户 发帖 36 积分 160 | |
|
谢谢呀,真是大虾呀,好厉害。。。原来还有这么多玩法啊
可是,,可是,,, 我说实话吧,我的VC根本就没有IDE呀,呜呜呜。。。 我都是用命令行的,也不知道IDE还有这些功能哪。。。 刚看了一下,找了半天,终于找出来了。。 =================== 这是cl.exe的说明 C/C++ COMPILER OPTIONS -OPTIMIZATION- /O1 minimize space /Op improve floating-pt consistency /O2 maximize speed /Os favor code space /Oa assume no aliasing /Ot favor code speed /Ob<n> inline expansion (default n=0) /Ow assume cross-function aliasing /Od disable optimizations (default) /Ox maximum opts. (/Ogityb1 /Gs) /Og enable global optimization /Oy enable frame pointer omission /Oi enable intrinsic functions -CODE GENERATION- /G3 optimize for 80386 /Gy separate functions for linker /G4 optimize for 80486 /Ge force stack checking for all funcs /G5 optimize for Pentium /Gs disable stack checking calls /G6 optimize for Pentium Pro /Gh enable hook function call /GB optimize for blended model (default) /GR enable C++ RTTI /Gd __cdecl calling convention /GX enable C++ EH (same as /EHsc) /Gr __fastcall calling convention /Gi enable incremental compilation /Gz __stdcall calling convention /Gm enable minimal rebuild /GA optimize for Windows Application /EHs enable synchronous C++ EH /GD optimize for Windows DLL /EHa enable asynchronous C++ EH /Gf enable string pooling /EHc extern "C" defaults to nothrow /GF enable read-only string pooling /QIfdiv enable Pentium FDIV fix /GZ enable runtime debug checks /QI0f enable Pentium 0x0f fix -OUTPUT FILES- /Fa name assembly listing file /Fo<file> name object file /FA configure assembly listing /Fp<file> name precompiled header file /Fd name .PDB file /Fr name source browser file /Fe<file> name executable file /FR name extended .SBR file /Fm name map file -PREPROCESSOR- /C don't strip comments /FI<file> name forced include file /D<name>{=|#}<text> define macro /U<name> remove predefined macro /E preprocess to stdout /u remove all predefined macros /EP preprocess to stdout, no #line /I<dir> add to include search path /P preprocess to file /X ignore "standard places" -LANGUAGE- /Zi enable debugging information /Zl omit default library name in .OBJ /ZI enable Edit and Continue debug info /Zg generate function prototypes /Z7 enable old-style debug info /Zs syntax check only /Zd line number debugging info only /vd{0|1} disable/enable vtordisp /Zp pack structs on n-byte boundary /vm<x> type of pointers to members /Za disable extensions (implies /Op) /noBool disable "bool" keyword /Ze enable extensions (default) -MISCELLANEOUS- /?, /help print this help message /V<string> set version string /c compile only, no link /w disable all warnings /H<num> max external name length /W<n> set warning level (default n=1) /J default char type is unsigned /WX treat warnings as errors /nologo suppress copyright message /Yc create .PCH file /Tc<source file> compile file as .c /Yd put debug info in every .OBJ /Tp<source file> compile file as .cpp /Yu use .PCH file /TC compile all files as .c /YX automatic .PCH /TP compile all files as .cpp /Zm<n> max memory alloc (% of default) -LINKING- /MD link with MSVCRT.LIB /MDd link with MSVCRTD.LIB debug lib /ML link with LIBC.LIB /MLd link with LIBCD.LIB debug lib /MT link with LIBCMT.LIB /MTd link with LIBCMTD.LIB debug lib /LD Create .DLL /F<num> set stack size /LDd Create .DLL debug libary /link ======================================= ======================================== 这是link.exe的说明: Microsoft (R) Incremental Linker Version 6.00.8447 Copyright (C) Microsoft Corp 1992-1998. All rights reserved. usage: LINK options: /ALIGN:# /BASE:{address|@filename,key} /COMMENT:comment /DEBUG /DEBUGTYPE:{CV|COFF} /DEF:filename /DEFAULTLIB:library /DELAY:{NOBIND|UNLOAD} /DELAYLOAD:dll /DLL /DRIVER /ENTRY:symbol /EXETYPE:DYNAMIC /EXPORT:symbol /FIXED /FORCE /GPSIZE:# /HEAP:reserve /IMPLIB:filename /INCLUDE:symbol /INCREMENTAL:{YES|NO} /LARGEADDRESSAWARE /LIBPATH:dir /LINK50COMPAT /MACHINE:{ALPHA|ARM|IX86|MIPS|MIPS16|MIPSR41XX|PPC|SH3|SH4} /MAP /MAPINFO:{EXPORTS|FIXUPS|LINES} /MERGE:from=to /NODEFAULTLIB /NOENTRY /NOLOGO /OPT:{ICF|NOICF|NOREF|NOWIN98|REF|WIN98} /ORDER:@filename /OUT:filename /PDB:{filename|NONE} /PDBTYPE:{CON|SEPT} /PROFILE /RELEASE /SECTION:name, /STACK:reserve /STUB:filename /SUBSYSTEM:{NATIVE|WINDOWS|CONSOLE|WINDOWSCE|POSIX}] /SWAPRUN:{CD|NET} /TSAWARE /VERBOSE /VERSION:# /VXD /WARN /WINDOWSCE:{CONVERT|EMULATION} /WS:AGGRESSIVE ================================== 好象在link里面有这项功能,谢谢乐,新年快乐。。。 :) [ Last edited by poor on 2006-12-30 at 03:19 AM ] |
|
| 第4楼 xxxxzzzz | 发表于 2007-01-07 13:49 |
| 初级用户 发帖 54 积分 138 | |
|
ok 每个程序不论大小,都要加载基本功能,即使你没有使用,象基本輸入輸出視頻設制声音等基本全部己經加载.
|
|
| 第5楼 xxxxzzzz | 发表于 2007-01-07 13:50 |
| 初级用户 发帖 54 积分 138 | |
|
木 林區
|
|
| 第6楼 xxxxzzzz | 发表于 2007-01-07 13:50 |
| 初级用户 发帖 54 积分 138 | |
|
木 \-
|
|
| 第7楼 xxxxzzzz | 发表于 2007-01-07 13:51 |
| 初级用户 发帖 54 积分 138 | |
|
0'[ ]-
)\] |
|
|
[ 联系联盟系统管理团队 -
中国DOS联盟 -
标准版 ] Sponsored by ifanr Inc | © 2001–2023 |