Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Including headers from custom framework in XCode

Am I supposed to adjust FRAMEWORK_SEARCH_PATHS or HEADER_SEARCH_PATHS when I add custom frameworks to the project?

I have MainProject.xcodeproject that links SomeFramework.framework that's simply dragged from "Products" in SomeFramework.xcodeproject to "Link with Binary Libraries" build phase in main project.

Framework contains all required headers in its Headers directory. However, in my project I can't simply use:

#import <SomeFramework.h> // I'm pretty sure this file exists

to include this header. Build fails "No such file or directory". Compiler flags include -F…/SomeFramework/build/Release and that directory contains framework with Headers directory symlink in it.

(BTW: this is for Mac OS X. I don't care about iPhone.)

like image 811
Kornel Avatar asked Oct 14 '10 22:10

Kornel


People also ask

How do I open a header file in Xcode?

Holding the Command key, click the import/include statement to view the header. Also, you can Command-click on a symbol to jump to the header file that defines it.

What is header search path in Xcode?

Xcode uses Clang which has GCC compatible command set. GCC has an option -Idir which adds system header searching paths. And this option is accessible via HEADER_SEARCH_PATHS in Xcode project build setting.

How do I import framework into Xcode?

To include a framework in your Xcode project, choose Project > Add to Project and select the framework directory. Alternatively, you can control-click your project group and choose Add Files > Existing Frameworks from the contextual menu.


1 Answers

Just adding the path to the directory containing the framework to FRAMEWORK_SEARCH_PATHS will work. Unless it's a typo, your problem seems to be

#import <SomeFramework.h>

which should be

#import <SomeFramework/SomeFramework.h>
like image 179
w-m Avatar answered Oct 24 '22 18:10

w-m