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. openfire Android 学习(四)----单人聊天和多人聊天(发送消息、接收消息)

    一.单人聊天 1)发送消息: 首先要获取一个聊天窗口,getConnection()为获取连接connection的方法,调用getFriendChat()获取 [java] view plainco ...

  2. 进程间通信IPC、LPC、RPC

    进程间通信(IPC,Inter-Process Communication),指至少两个进程或线程间传送数据或信号的一些技术或方法.进程是计算机系统分配资源的最小单位.每个进程都有自己的一部分独立的系 ...

  3. [反汇编练习] 160个CrackMe之030

    [反汇编练习] 160个CrackMe之030. 本系列文章的目的是从一个没有任何经验的新手的角度(其实就是我自己),一步步尝试将160个CrackMe全部破解,如果可以,通过任何方式写出一个类似于注 ...

  4. 文本聚类——Kmeans

    上两篇文章分别用朴素贝叶斯算法和KNN算法对newgroup文本进行了分类測试.本文使用Kmeans算法对文本进行聚类. 1.文本预处理 文本预处理在前面两本文章中已经介绍,此处(略). 2.文本向量 ...

  5. android客户端向服务器端验证登陆方法的实现2

    一.在上一篇文章中,我只是提到了其中一种方法来实现登陆 大家可以参见: http://www.apkbus.com/android-45004-1-1.html      android获取web服务 ...

  6. 数据结构与算法——AVL树类的C++实现

    关于AVL树的简单介绍能够參考:数据结构与算法--AVL树简单介绍 关于二叉搜索树(也称为二叉查找树)能够參考:数据结构与算法--二叉查找树类的C++实现 AVL-tree是一个"加上了额外 ...

  7. CentOs中mysql的安装与配置(转)

    在linux中安装数据库首选MySQL,Mysql数据库的第一个版本就是发行在Linux系统上,其他选择还可以有postgreSQL,oracle等 在Linux上安装mysql数据库,我们可以去其官 ...

  8. android中的常见对话框

    在android中对话框是一种常见的操作,常见的对话框有下面几种: 以下是xml布局文件: <LinearLayout xmlns:android="http://schemas.an ...

  9. Fedora 25/24/23 nVidia Drivers Install Guide

    https://www.if-not-true-then-false.com/2015/fedora-nvidia-guide/ search Most Popular Featured Linux ...

  10. HDU 5145 NPY and girls (莫队分块离线)

    题目地址:HDU 5145 莫队真的好奇妙.. 这种复杂度竟然仅仅有n*sqrt(n)... 裸的莫队分块,先离线.然后按左端点分块,按块数作为第一关键字排序.然后按r值作为第二关键字进行排序. 都是 ...