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.
Asked
Active
Viewed 978 times
1

Brian Tompsett - 汤莱恩
- 5,753
- 72
- 57
- 129

Qbik
- 5,885
- 14
- 62
- 93
2 Answers
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 dev-c++ 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
-
I don't want run it I just want to see effects of preprocessing, mayby I should be more clear, could you give me any clues how to do this ? – Qbik Feb 27 '13 at 19:36
-
See my comment on @zacaj's answer. – πάντα ῥεῖ Feb 27 '13 at 20:08
-
Dev-C++ has an option in Tools > Compiler Options... > General to add commands when calling the compiler. – Kyle Delaney Aug 18 '16 at 03:45
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
-
-
@Qbik yes at least run it through console and ensure passing all (preprocessor relevant) options you have set in your IDE. – πάντα ῥεῖ Feb 27 '13 at 20:07