
Signature
Thanks,
Michael S. Wells \|/
Software Engineer ^O-O^
---------------------------o00o--(_)--o00o----------------------------
> I am trying to "clean up" a solution with 10 projects and I was wondering if
> there is a way to "traverse" the source files to find not only the #includes
> but also remove #includes that are not needed for a file.
There is no automatic way that I know of, but perhaps the following might
help.
You could use /showIncludes to show you which include files are used during
the compilation process.
Compare this against the list of all include files, and remove what is not
used anymore.
For knowing which sourcefiles are not used anymore, you could parse the
project files. they are XML.
compare that against the list of all available source files and you know
what can be removed.
If you are famailiar with a scripting language you could sort of automate
this process yourself.
you have to do a backup before you do this, obviously.

Signature
Kind regards,
Bruno.
bruno_nos_pam_van_dooren@hotmail.com
Remove only "_nos_pam"
Mihajlo Cvetanović - 14 Jul 2006 13:45 GMT
>>I am trying to "clean up" a solution with 10 projects and I was wondering if
>>there is a way to "traverse" the source files to find not only the #includes
[quoted text clipped - 7 lines]
> Compare this against the list of all include files, and remove what is not
> used anymore.
There is one small caveat. Some header files may belong to the project
under special conditions, and may or may not be #included depending on
some preprocessor macro. Even a source file may belong to a project, but
is left out in default configuration.
One safe way would be to manually traverse through vcproj file, and
gather all source files from it, then search through all source files
for #include "" (ignore #include <>) directives, then include all found
files in search list and repeat the search as long as the search list
expands. In the end the search list becomes the project list.
I can only guess there is a tool that does exactly this.