Search Paths E-mail

Someone asked me what the difference was between:

#import "file.h"

and

#import

The difference is where XCode will look for file.h.  With quotes, it will look relative to the file that has the import statement.  The version will go through the search paths looking for file.h.

I found documentation on Search Paths, but I haven't been able to find what the default values (XCode level, not project level) are on my machine or if I can change them.

 

The hunt continues...

 

UPDATE:  I found a way to dump the environment variables:

  • Go to Project -> New Build Phase -> New Run Script Build Phase.
  • Add an echo statement to the script.
  • Check the "Show environment variables in build log" checkbox.
  • Go to Build -> Build Results to open the build log.
  • Then just do Build.

Unfortunately, this didn't produce the results I was looking for.  The search paths are just showing as the directory my project is in with include, etc appended.

 

Looking at the build log, I was able to find the version of gcc XCode is using and run it to print some search path info.  Unfortunatley, no include search path info:

sh-3.2# /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc-4.0 -print-search-dirs

  • install: /usr/lib/gcc/i686-apple-darwin9/4.0.1/
  • programs: =/Developer/usr/bin/../libexec/gcc/i686-apple-darwin9/4.0.1/:/Developer/usr/bin/../libexec/gcc/:/usr/libexec/gcc/i686-apple-darwin9/4.0.1/:/usr/libexec/gcc/i686-apple-darwin9/4.0.1/:/usr/libexec/gcc/i686-apple-darwin9/:/usr/lib/gcc/i686-apple-darwin9/4.0.1/:/usr/lib/gcc/i686-apple-darwin9/:/usr/libexec/gcc/i686-apple-darwin9/4.0.1/:/usr/libexec/gcc/i686-apple-darwin9/:/usr/lib/gcc/i686-apple-darwin9/4.0.1/:/usr/lib/gcc/i686-apple-darwin9/:/Developer/usr/bin/../lib/gcc/i686-apple-darwin9/4.0.1/../../../../i686-apple-darwin9/bin/i686-apple-darwin9/4.0.1/:/Developer/usr/bin/../lib/gcc/i686-apple-darwin9/4.0.1/../../../../i686-apple-darwin9/bin/:/usr/lib/gcc/i686-apple-darwin9/4.0.1/../../../../i686-apple-darwin9/bin/i686-apple-darwin9/4.0.1/:/usr/lib/gcc/i686-apple-darwin9/4.0.1/../../../../i686-apple-darwin9/bin/
  • libraries: =/lib/i686-apple-darwin9/4.0.1/:/lib/:/usr/lib/i686-apple-darwin9/4.0.1/:/usr/lib/:/Developer/usr/bin/../lib/gcc/i686-apple-darwin9/4.0.1/:/Developer/usr/bin/../lib/gcc/:/usr/lib/gcc/i686-apple-darwin9/4.0.1/:/usr/lib/gcc/i686-apple-darwin9/4.0.1/:/Developer/usr/bin/../lib/gcc/i686-apple-darwin9/4.0.1/../../../../i686-apple-darwin9/lib/i686-apple-darwin9/4.0.1/:/Developer/usr/bin/../lib/gcc/i686-apple-darwin9/4.0.1/../../../../i686-apple-darwin9/lib/:/usr/lib/gcc/i686-apple-darwin9/4.0.1/../../../../i686-apple-darwin9/lib/i686-apple-darwin9/4.0.1/:/usr/lib/gcc/i686-apple-darwin9/4.0.1/../../../../i686-apple-darwin9/lib/:/Developer/usr/bin/../lib/gcc/i686-apple-darwin9/4.0.1/../../../i686-apple-darwin9/4.0.1/:/Developer/usr/bin/../lib/gcc/i686-apple-darwin9/4.0.1/../../../:/usr/lib/gcc/i686-apple-darwin9/4.0.1/../../../i686-apple-darwin9/4.0.1/:/usr/lib/gcc/i686-apple-darwin9/4.0.1/../../../

 

Meh.  If I ever find it, I'll let you know.