combine "include files" in one

K

Kayıhan

i wonder ,is it possible to see all include files (used in a project) in one
file.
i mean also if a define statement neglates the other, i dont want to see it
in the file.
i just want to see what is what, simple and together
Thanks for answers
 
B

Bob Milton

You can always use /P on the command line to preprocess the source file
to a file. This will go through all the prepocessor steps (substituting
macros, including files, skipping parts of includes, etc). By forwearned -
the output file can be quite large, particularly if you include something
like windows.h
Bob
 
B

Ben Voigt [C++ MVP]

Bob said:
You can always use /P on the command line to preprocess the source
file to a file. This will go through all the prepocessor steps
(substituting macros, including files, skipping parts of includes,
etc). By forwearned - the output file can be quite large,
particularly if you include something like windows.h
Bob

gcc does a little better:

Try
g++ -MP -P source.cpp
 
H

H Brydon

Kayıhan said:
i wonder ,is it possible to see all include files (used in a project) in
one
file.
i mean also if a define statement neglates the other, i dont want to see
it
in the file.
i just want to see what is what, simple and together
Thanks for answers

If you want to see which files are included for a given source file, you
want to add the "/showIncludes" switch to the command line. This can be
done either for the whole project or just for a specific *.cpp file(s).

If you are asking how to combine common include files to somehow reduce your
apparent lines of code, you probably want to add most of your include files
to stdafx.h and do some basic research on "precompiled headers". You
generally don't want to add any of your own header files to stdafx.h.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top