在 XCode 中包含来自自定义框架的标头
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/3938194/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Including headers from custom framework in XCode
提问by Kornel
Am I supposed to adjust FRAMEWORK_SEARCH_PATHS
or HEADER_SEARCH_PATHS
when I add custom frameworks to the project?
我应该调整FRAMEWORK_SEARCH_PATHS
还是HEADER_SEARCH_PATHS
当我向项目添加自定义框架时?
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.
我有MainProject.xcodeproject
一些链接SomeFramework.framework
,它只是从“产品”拖到SomeFramework.xcodeproject
主项目中的“链接与二进制库”构建阶段。
Framework contains all required headers in its Headers
directory. However, in my project I can't simply use:
框架在其Headers
目录中包含所有必需的头文件。但是,在我的项目中,我不能简单地使用:
#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.
包括这个标题。构建失败“没有这样的文件或目录”。编译器标志包括-F…/SomeFramework/build/Release
并且该目录包含带有Headers
目录符号链接的框架。
(BTW: this is for Mac OS X. I don't care about iPhone.)
(顺便说一句:这是针对 Mac OS X 的。我不在乎 iPhone。)
采纳答案by w-m
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
只需将包含框架的目录的路径添加到 FRAMEWORK_SEARCH_PATHS 即可。除非是打字错误,否则您的问题似乎是
#import <SomeFramework.h>
which should be
这应该是
#import <SomeFramework/SomeFramework.h>