问题
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.
回答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.
回答2:
run
gcc file.cpp -E -o file_preprocessed.cpp
then you can open file_preprocessed.cpp to see the output
来源:https://stackoverflow.com/questions/15119998/how-to-get-preprocessed-code-from-dev-c-under-windows-xp