E
eric
Any C/C++ tools out there that can generate/display header
dependencies (i.e. order of inclusion), possibly in visual format
(e.g. graphs)?
The dependencies generated by most compilers only show all header
dependencies of a source file. That is, if you have one source file
that includes many header files, a typical compiler will only generate
a single Makefile dependency rather than individual dependencies. For
example:
[user@host dependencies]$ ls
test01.h test02.h test03.h test04.cpp test04.h
[user@host dependencies]$ more test*
::::::::::::::
test01.h
::::::::::::::
#define FOO foo
::::::::::::::
test02.h
::::::::::::::
#include "test03.h"
::::::::::::::
test03.h
::::::::::::::
#define BAR bar
::::::::::::::
test04.cpp
::::::::::::::
#include "test04.h"
int main () {
return 0;
}
::::::::::::::
test04.h
::::::::::::::
#include "test01.h"
#include "test02.h"
[user@host dependencies]$ g++ -MM test04.cpp
test04.o: test04.cpp test04.h test01.h test02.h test03.h
What I would like to see is something like this:
test04.o: test04.cpp test04.h
test04.h: test01.h test02.h
test02.h: test03.h
Would greatly appreciate any tips, pointers, links, etc.
Eric.
dependencies (i.e. order of inclusion), possibly in visual format
(e.g. graphs)?
The dependencies generated by most compilers only show all header
dependencies of a source file. That is, if you have one source file
that includes many header files, a typical compiler will only generate
a single Makefile dependency rather than individual dependencies. For
example:
[user@host dependencies]$ ls
test01.h test02.h test03.h test04.cpp test04.h
[user@host dependencies]$ more test*
::::::::::::::
test01.h
::::::::::::::
#define FOO foo
::::::::::::::
test02.h
::::::::::::::
#include "test03.h"
::::::::::::::
test03.h
::::::::::::::
#define BAR bar
::::::::::::::
test04.cpp
::::::::::::::
#include "test04.h"
int main () {
return 0;
}
::::::::::::::
test04.h
::::::::::::::
#include "test01.h"
#include "test02.h"
[user@host dependencies]$ g++ -MM test04.cpp
test04.o: test04.cpp test04.h test01.h test02.h test03.h
What I would like to see is something like this:
test04.o: test04.cpp test04.h
test04.h: test01.h test02.h
test02.h: test03.h
Would greatly appreciate any tips, pointers, links, etc.
Eric.