Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How does Xcode know where to look for a framework?

Example: I import a framework like this:

#import <Cocoa/Cocoa.h>

Now what's that "Cocoa/Cocoa.h" path? I mean... from where does Xcode start looking? Where is this configured? And is that actually a path or something? What's "Cocoa/Cocoa.h" really? A namespace and a framework in there? Or what else?

like image 823
openfrog Avatar asked Dec 10 '09 22:12

openfrog


1 Answers

This is in the xcode documentation:

http://developer.apple.com/mac/library/documentation/DeveloperTools/gcc-4.0.1/cpp/Search-Path.html#Search-Path

2.3 Search Path GCC looks in several different places for headers. On a normal Unix system, if you do not instruct it otherwise, it will look for headers requested with #include in:

 /usr/local/include
 libdir/gcc/target/version/include
 /usr/target/include
 /usr/include

For C++ programs, it will also look in /usr/include/g++-v3, first. In the above, target is the canonical name of the system GCC was configured to compile code for; often but not always the same as the canonical name of the system it runs on. version is the version of GCC in use.

</snip>

like image 176
Andrew Rollings Avatar answered Nov 14 '22 03:11

Andrew Rollings