如何查看Visual C ++预处理器的输出? [重复]

时间:2022-06-09 08:53:31

This question already has an answer here:

这个问题在这里已有答案:

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?

我想在我的代码上看到Visual C ++预处理器的输出 - 即相当于gcc -E。对于我的生活,我找不到相关的编译器开关。我该如何做到这一点?

2 个解决方案

#1


16  

cl.exe, the command line interface to Microsoft Visual C++, has three different options for outputting the preprocessed file (hence the inconsistency in the previous responses about Visual C++):

cl.exe,Microsoft Visual C ++的命令行界面,有三个不同的选项用于输出预处理文件(因此在以前的Visual C ++响应中不一致):

(copied directly from https://*.com/a/277362/3279)

(直接从https://*.com/a/277362/3279复制)

#2


23  

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

项目属性 - > C / C ++ - >预处理 - >预处理到文件:是(/ P)

Also see the msdn page.

另请参阅msdn页面。

#1


16  

cl.exe, the command line interface to Microsoft Visual C++, has three different options for outputting the preprocessed file (hence the inconsistency in the previous responses about Visual C++):

cl.exe,Microsoft Visual C ++的命令行界面,有三个不同的选项用于输出预处理文件(因此在以前的Visual C ++响应中不一致):

(copied directly from https://*.com/a/277362/3279)

(直接从https://*.com/a/277362/3279复制)

#2


23  

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

项目属性 - > C / C ++ - >预处理 - >预处理到文件:是(/ P)

Also see the msdn page.

另请参阅msdn页面。