Command to list all header files used to create an executable

All,

   I would like to know if there is a command which will list all the header files which were used while creating the executable.

The c/c++ compiler has an option to print them, often: the source dependencies: Man Page for cc (all Section 0) - The UNIX and Linux Forums -M and such.

If the object is not stripped, you can run it through strings to see what header file SCCS strings are present using 'what'. Sometimes strings hides these, but I can dig out all strings using cat and tr:

$ cat -vt local/bin/vncviewer|tr '@^' '\12\12'|fgrep '.h'|pg
AM-.h
A.h
IM-.h
IM-.h
E .h 
V.h 
../rfb/zrleEncode.h
../rfb/zrleDecode.h
IM-.h
AM-.h
AM-.h
../../../src/libio/streambuf.h
../../../src/libio/streambuf.h
../../../src/libio/streambuf.h
../../../src/libio/streambuf.h
../../../src/libio/streambuf.h
../../../src/libio/streambuf.h
../../../src/libio/streambuf.h
../../../src/libio/streambuf.h
../../../src/libio/streambuf.h
../../../src/libio/streambuf.h
../../../src/libio/streambuf.h
../../../src/libio/iostream.h
../../../src/libio/streambuf.h
: