How do I see a C/C++ source file after preprocessing in Visual Studio?

前端 未结 10 955
一个人的身影
一个人的身影 2020-11-22 05:44

Let\'s say I have a source file with many preprocessor directives. Is it possible to see how it looks after the preprocessor is done with it?

10条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-11-22 06:16

    I don't know anything about Microsoft compiler, but on GCC you can use this:

    gcc -E -P -o result.c my_file.h
    

    If you want to see comments use this:

    gcc -E -C -P -o result.c my_file.h
    

    More options avaliable on this page.

提交回复
热议问题