Re: #include dependency tools?
Re: #include dependency tools?
- Subject: Re: #include dependency tools?
- From: Mark Lentczner <email@hidden>
- Date: Wed, 5 Jan 2005 14:58:45 -0800
Jan 5, 2005 kl. 10:55 PM skrev Andy Wiese:
I would like to determine exactly what header files are included in
my c++ project. I know that header dependency tools exist, but I've
never used them, and don't know what might be available and usable
with Xcode/gcc/os-x without too much brain damage.
gcc is your friend! It has the wonderful '-MM' option, which will
generate exactly the list you want!
Typical usage:
gcc -MM *.cpp
Though, if you have special include directories and/or defines it would
be more like:
gcc -MM -Iincs -DFEATURE_FOO=1 *.cpp
You can just build the app normally in Xcode, then in the build window,
open up the middle pane and simply grab a gcc line to see what the -I
and -D you might need.
You'll need to do a little post-processing, since this lists the
include files needed for each source file individually. Try something
like:
gcc -MM *.cpp | tr ' ' '\n' | sort -u
By the way, you can find gcc doc on this at:
file:///Developer/ADC Reference Library/documentation/
DeveloperTools/gcc-3.3/gcc/Preprocessor-
Options.html#Preprocessor Options
Note: This is a "file:" URL 'cause this doc is already on your disk!
(That URL is for Xcode 1.5 installs, as the docs seemed to have been
elsewhere in 1.2...)
- Mark
Mark Lentczner
email@hidden
http://www.wheatfarm.org/
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden