zoukankan      html  css  js  c++  java
  • c/c++生成预编译文件

    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
  • 相关阅读:
    【转载】Linux 内核启动时间分析
    hackbench
    c用户组函数
    c环境变量操作函数
    c网络接口套接字函数
    c信号处理函数
    c进程操作函数
    c文件内容操作函数
    c文件操作
    c数据结构和算法
  • 原文地址:https://www.cnblogs.com/shanql/p/6388968.html
Copyright © 2011-2022 走看看