This might sound like a very weird question, but I do need this: I have a bunch of c++ header files (from some header-only libraries) and a single cpp file. What I'd like to do is generate a single cpp file that has no includes whatsoever.
Why? For a contest, in which the compiler doesn't have some libraries I'm using, and one in which you can only submit one single cpp file.
Ideally, this "script" would create a file that uses only what is actually needed, not just copy and paste recursively all "#includes".
I'm sure that the preprocessor generates some files when you add an "#include" in the code. So, how can I see these intermediate and (probably very long) files?