• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: #include dependency tools?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

References: 
 >#include dependency tools? (From: Andy Wiese <email@hidden>)
 >Re: #include dependency tools? (From: Tommy Nordgren <email@hidden>)

  • Prev by Date: Re: XCode and STL/STD code completion/code sense - possible???
  • Next by Date: XCode aggregate project with precompiled headers
  • Previous by thread: Re: #include dependency tools?
  • Next by thread: XCode aggregate project with precompiled headers
  • Index(es):
    • Date
    • Thread