Preprocesses C and C++ source files and writes the preprocessed output to a file.

 
/P

Remarks

The file has the same base name as the source file and an .i extension. In the process, all preprocessor directives are carried out, macro expansions are performed, and comments are removed. To preserve comments in the preprocessed output, use the /C (Preserve Comments During Preprocessing) option along with /P.

/P adds #line directives to the output, at the beginning and end of each included file and around lines removed by preprocessor directives for conditional compilation. These directives renumber the lines of the preprocessed file. As a result, errors generated during later stages of processing refer to the line numbers of the original source file rather than lines in the preprocessed file. To suppress the generation of #line directives, use /EP (Preprocess to stdout Without #line Directives) as well as /P.

The /P option suppresses compilation. It does not produce an .obj file, even if you use /Fo (Object File Name). You must resubmit the preprocessed file for compilation. /P also suppresses the output files from the /FA, /Fa (Listing File), /FA, /Fa (Listing File), and /Fm (Name Mapfile) options.

To set this compiler option in the Visual Studio development environment

  1. Open the project's Property Pages dialog box. For details, see How to: Open Project Property Pages.

  2. Click the C/C++ folder.

  3. Click the Preprocessor property page.

  4. Modify the Generate Preprocessed File property.

To set this compiler option programmatically

  • See GeneratePreprocessedFile.

Example

The following command line preprocesses ADD.C, preserves comments, adds #line directives, and writes the result to a file, ADD.I:

  Copy Code
CL /P /C ADD.C

c/c++生成预编译文件的更多相关文章

  1. iOS xcode6添加预编译文件

    在xcode6以后,由于苹果不建议开发者乱用预编译文件,所以,在项目创建之后 就不会自动生成预编译文件. 那么如果我们想要使用预编译文件,就需要自己动手来添加.那到底该如何为我们的项目添加预编译文件呢 ...

  2. ASP.NET最误导人的错误提示:“未预编译文件,因此不能请求该文件”

    昨天在一个ASP.NET MVC项目中,一个预编译后的视图访问时总是报错: 未预编译文件,因此不能请求该文件(The file has not been pre-compiled, and canno ...

  3. 怎么向Xcode6 IOS8之后向项目中添加预编译文件

    苹果的XCode在6版本之后新建项目时取消了自动创建预编译头文件pch,该文件里存放的工程中一些不常被修改的代码,比如常用的框架头文件,这样做的目的提高编译器编译速度.我们可以往里面加入一些项目中都要 ...

  4. cocos 3.16 生成预编译库模板

    打开模板功能 不知道什么原因,cocos 3.16关闭了模板功能,因此使用cocos -h命令时,无法显示gen-templates参数. 打开的方式也挺简单,打开tools/cocos2d-cons ...

  5. 问题处理:找不到Pch预编译文件?

    提醒:Xcode6之后就不再自动创建Pch预编译文件 在Xcode6之前,创建一个新工程xcode会在Supporting files文件夹下面自动创建一个“工程名-Prefix.pch”文件,也是一 ...

  6. iOS开发之Xcode6 之手动添加Pch预编译文件

    参考文档 http://blog.csdn.net/crazyzhang1990/article/details/44243343 红色部分为本人自己补充注意事项 在Xcode6之前,创建一个新工程x ...

  7. Xcode6之后创建Pch预编译文件

    在Xcode6之前,创建一个新工程xcode会在Supporting files文件夹下面自动创建一个“工程名-Prefix.pch”文件,也是一个头文件,pch头文件的内容能被项目中的其他所有源文件 ...

  8. 使用pch预编译文件

    首先新建一个pch文件,然后要修改这个项目的Build Setting中的Prefix Header   修改为 $(SRCROOT)/项目名称/预编译文件名: 一般pch文件的用处: 1.导入框架, ...

  9. IOS使用pch预编译文件

    首先新建一个pch文件,然后要修改这个项目的Build Setting中的Prefix Header 修改为 $(SRCROOT)/项目名称/预编译文件名: 一般pch文件的用处: 1.导入框架,如: ...

随机推荐

  1. 【零基础学习iOS开发】【01-前言】02-准备

    一.程序设计语言 上一讲已经说到:要想开发一款软件,首先得学习一些对应的程序设计语言. 至于iOS开发,须要学习的语言主要有:C.C++.Objective-C. 回到顶部 二.是否须要计算机专业知识 ...

  2. HEVC的參考队列解码

    參考队列是指在进行帧间解码时.P或者B slice所參考的已解码的.位于解码图像缓存中(DPB, decoded picture buffer)中的图像队列,类似h264中的reflist0和refl ...

  3. java中Volatile修饰符的含义

    在java语言中:为了获得最佳速度,同意线程保存共享成员变量的私有拷贝.并且仅仅当线程进入或者离开同步代码块时才与共享成员变量的原始值进行对照. volatilekeyword的作用就是提示vm:对于 ...

  4. USACO 1.2 Milking Cows (枚举)

    标记数组(哈希) 1e6的范围,开一个char数组全然能够,有人为1,无人为0,注意边界就可以.最后线性扫描就可以. 时间复杂度,应该是O(n),n为最后结束的时间. 缺点就是--比較慢 /* ID: ...

  5. 解决MySQL出现大量unauthenticated user的问题

    近期OJ及相关的站点打开异常的慢,简直崩溃,一直没找着原因. 进入数据库server.进到mysql里,用show processlist命令查看一下,发现有非常多的unauthenticated u ...

  6. Android Studio 那些事|Activity文件前标识图标显示为 j 而是 c

    问题:Activity文件前标识图标显示为 j 而是 c 的图标,或是没有显示,并且自己主动提示不提示 watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQv/fo ...

  7. MongoDB的一些操作技巧

    去年三月底入职上海的一家互联网公司,由于项目使用的是MongoDB数据库所以有机会接触了MongoDB.在项目的开发过程中使用系统原有的一些方法查询MongoDB感觉很费力,用起来也不爽,所以私下里就 ...

  8. Hadoop集群_HDFS初探之旅

    1.HDFS简介 HDFS(Hadoop Distributed File System)是Hadoop项目的核心子项目,是分布式计算中数据存储管理的基础,是基于流数据模式访问和处理超大文件的需求而开 ...

  9. ESXi 5.5 RTL9168E网卡驱动 找到网卡

    如果你对专业服务器的价格望而却步,恰巧又想在普通的PC上安装ESXi,恰巧又是ESXi 5.5版本,那么这篇文章中提及的问题你可能会遇到,并能给你提供一些帮助. 1.成功安装重启以后提示“no boo ...

  10. Vue 向下扩展后就类似于 jQuery

    https://cn.vuejs.org/v2/guide/comparison.html