1

How to get preprocessed C++ code from DevC++ under Windows XP? I've read about creating gcc -E file.cpp file, but I still can't connect the dots, how to run this file? After I've compiled it everything went as usual.

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
Qbik
  • 5,885
  • 14
  • 62
  • 93

2 Answers2

1

You simply can't 'run' a preprocessed file. You can just compile and run it, or inspect it for what the preprocessor produced.

E.g. when using GCC you can run

gcc file.cpp -E <all preprocessor options as set from the IDE> -o file_preprocessed.cpp

to get the file_preprocessed.cpp file for inspection.

I don't know for the IDE in particular, but usually you'll get a representation of the actually used compiler flags of a project in the project settings somewhere.

πάντα ῥεῖ
  • 1
  • 13
  • 116
  • 190
1

run

gcc file.cpp -E -o file_preprocessed.cpp

then you can open file_preprocessed.cpp to see the output

zacaj
  • 1,987
  • 1
  • 19
  • 39