How to apply a C preprocessor only to certain (#if/#endif) directives?

后端 未结 4 1881
攒了一身酷
攒了一身酷 2021-01-16 04:27

I was wondering if it is possible, and if yes how, can I run a C preprocessor, like cpp, on a C++ source file and only process the conditional directives #

4条回答
  •  不思量自难忘°
    2021-01-16 04:56

    You can use g++ -E option to stop after preprocessing stage

    -E -> stop after the preprocessing stage.The output is in the form of preprocessed source code, which is sent to the standard output

提交回复
热议问题