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?
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.
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With