13

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.)

Kornel
  • 97,764
  • 37
  • 219
  • 309

1 Answers1

12

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>
w-m
  • 10,772
  • 1
  • 42
  • 49
  • It wasn't a typo! I'm half-there. Now the second problem is that `SomeFramework/SomeFramework.h` contains `#import `. Is that the same error in the framework too? – Kornel Oct 14 '10 at 23:31
  • Yes, in that case it should be #import "SomeFrameworksOtherHeader.h" – w-m Oct 14 '10 at 23:36
  • 1
    Hi. thanks, that answer helped me out in my project :) but i have another question regarding this subject. with #include works fine, but i wanted to have only #include and this time it doesn't find the header.. And with FRAMEWORK_SEARCH_PATHS containing the directory of the framework doesn't change anything.. any thoughts? :) thks! – StinkyCat Aug 15 '12 at 12:58
  • 1
    Well i actually got it working if I set the path to the Headers symlink of my framework in the HEADER_SEARCH_PATHS, but this solution is not ideal.. Is there any other way? thks! – StinkyCat Aug 15 '12 at 13:49
  • I'm not sure what you are trying to achieve. Maybe you should start another question. – w-m Aug 15 '12 at 18:19
  • And what is the path??? Surely you don't mean an absolute path then release/debug wouldn't work anymore. – malhal Jan 26 '16 at 00:02