免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 2432 | 回复: 9
打印 上一主题 下一主题

[C++] 用过vc6.0的请进 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2009-01-04 10:07 |只看该作者 |倒序浏览
请问,在vc6下如何得到预编译后的中间文件?

论坛徽章:
0
2 [报告]
发表于 2009-01-04 10:08 |只看该作者
要是linux下就好做了,从linux平台转到win32平台真是痛苦。

论坛徽章:
1
2017金鸡报晓
日期:2017-01-10 15:19:56
3 [报告]
发表于 2009-01-04 12:37 |只看该作者
不是*.obj吗

论坛徽章:
0
4 [报告]
发表于 2009-01-04 12:39 |只看该作者
obj是中间代码,但不是预编译后的代码吧,我想得到在linux平台下那样的预编译文件。gcc -E 。。。

论坛徽章:
0
5 [报告]
发表于 2009-01-04 15:04 |只看该作者
google 搜索 vc  预处理器

论坛徽章:
0
6 [报告]
发表于 2009-01-04 15:13 |只看该作者
win程序员们 一般不关心这个  

论坛徽章:
0
7 [报告]
发表于 2009-01-04 15:21 |只看该作者
我就是想农明白消息映射在代码中怎么实现的,宏定义了一大坨。

论坛徽章:
0
8 [报告]
发表于 2009-01-04 15:26 |只看该作者

回复 #7 eveson 的帖子

看下侯杰的深入浅出MFC。

论坛徽章:
0
9 [报告]
发表于 2009-01-04 17:46 |只看该作者
原帖由 wangqi0021 于 2009-1-4 15:13 发表
win程序员们 一般不关心这个  


2



----------------------
用/P  /EP宏就可以了,输出在.i文件里

论坛徽章:
0
10 [报告]
发表于 2009-01-04 18:48 |只看该作者
  1. vcvars32.bat
  2. cd %MSVCDir%\bin
  3. cl /help
复制代码

Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 12.00.8804 for 80x86
Copyright (C) Microsoft Corp 1984-1998. All rights reserved.

                          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[num] 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
(press <return> to continue)
/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[file] name assembly listing file     /Fo<file> name object file
/FA[sc] configure assembly listing       /Fp<file> name precompiled header file
/Fd[file] name .PDB file                 /Fr[file] name source browser file
/Fe<file> name executable file           /FR[file] name extended .SBR file
/Fm[file] 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
(press <return> to continue)
/Z7 enable old-style debug info          /Zs syntax check only
/Zd line number debugging info only      /vd{0|1} disable/enable vtordisp
/Zp[n] 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[file] 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[file] use .PCH file
/TC compile all files as .c              /YX[file] 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
(press <return> to continue)
/LDd Create .DLL debug libary            /link [linker options and libraries]

E:\PROGRA~1\MICROS~1\VC98\Bin>


用一样工具就用用好,这样其实根本不存在会不会、熟悉不熟悉、习惯不习惯、正宗不正宗的废话问题。
另外,这里没有什么“预编译”过程,建议看看红字,那个叫 preprocessing,预处理。
不要把“precompiled headers”和“preprocessed input”搞混起来。



[ 本帖最后由 langue 于 2009-1-4 18:57 编辑 ]
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP