Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I see the output of the Visual C++ preprocessor? [duplicate]

I want to see the output of the Visual C++ Preprocessor on my code -- i.e., the equivalent of gcc -E. For the life of me, I cannot find the relevant compiler switch. How do I accomplish this?

like image 399
Benjamin Pollack Avatar asked Jan 23 '12 21:01

Benjamin Pollack


People also ask

What is C preprocessor output?

When the C preprocessor is used with the C, C++, or Objective-C compilers, it is integrated into the compiler and communicates a stream of binary tokens directly to the compiler's parser. However, it can also be used in the more conventional standalone mode, where it produces textual output.

What is the extension of output file produced by preprocessor?

A preprocessed *. i file is an output of the C or C++ preprocessor. It is usually this extension which is characteristic of files created as the preprocessor output.


1 Answers

Project properties -> C/C++ -> Preprocessing -> Preprocess to a file: Yes (/P)

The files will be called .i and will be created in the build directory.

Also see the msdn page.

like image 88
Xeo Avatar answered Oct 09 '22 09:10

Xeo