简体   繁体   English

如何为OpenEars配置标题搜索路径

[英]How can I configure my header search paths for OpenEars

I am trying to include the OpenEars Framework in my project. 我试图在我的项目中包括OpenEars Framework。 But it does not seem to see the path to my headers unless I write the absolute path. 但是,除非编写绝对路径,否则似乎看不到标题的路径。

Absolute path works 绝对路径工程

#import </Absolute_PATH_To_Framework/OpenEars.framework/Headers/OELanguageModelGenerator.h>
#import <Absolute_PATH_To_Framework/Headers/OEAcousticModel.h>

The path from the framework does not work though #import #import 来自框架的路径虽然#import #import无效

OpenEars developer here. OpenEars开发人员在这里。 If you have an issue with including OpenEars' headers there is probably some other issue in the app, since configuring header search paths and/or giving unusual import statements aren't needed for using the framework. 如果您在包含OpenEars头文件时遇到问题,则应用程序中可能还有其他问题,因为使用框架不需要配置头文件搜索路径和/或给出不寻常的导入语句。 I recommend either following the tutorial here: http://www.politepix.com/openears/tutorial or examining the sample app that ships with OpenEars to compare against known-working examples of the framework being successfully added to a project. 我建议按照以下教程进行操作: http : //www.politepix.com/openears/tutorial或检查OpenEars附带的示例应用程序,以与成功添加到项目中的框架的已知有效示例进行比较。 If you want to troubleshoot it with me further, go ahead and bring your question over to the OpenEars forums since Stack Overflow isn't oriented towards in-depth troubleshooting processes. 如果您想进一步解决问题,请继续并将您的问题提交到OpenEars论坛,因为Stack Overflow并非针对深入的故障排除过程。

I know this is quite late to answer, I was facing this exact issue and wasted an entire day trying to figure out what was wrong. 我知道这是很晚才回答的问题,我面对着这个确切的问题,浪费了一整天试图找出问题所在。

Turns out we need to add the path for the framework under "Framework Search Paths" at Xcode Build Settings . 原来,我们需要在Xcode Build Settings的 “ Framework Search Paths”下添加框架的路径

The tutorial at OpenEars specifically mentions this point - OpenEars Tutorials OpenEars的教程特别提到了这一点-OpenEars教程

  1. Navigate to project Build Settings and find the setting "Framework Search Paths" 导航到项目“构建设置”,然后找到设置“框架搜索路径”
  2. The "Framework Search Path" for OpenEars is the path minus the last path element, so if it says as OpenEars的“框架搜索路径”是减去最后一个路径元素的路径,因此如果它表示为

     "/Users/you/Documents/YourApp/Resources/Framework/OpenEars.framework" 

    then it should be 那应该是

     "/Users/yourname/Documents/YourApp/Resources/Framework/" 
  3. Keep the "Recursive" checkbox unchecked 取消选中“递归”复选框

  4. Make sure to also set the Bridge header path under " Objective-C Bridging header " at Build Settings 确保还要在“构建设置”的“ Objective-C桥接标头 ”下设置桥标头路径

  5. Set the headers in the Bridge header file, and run the app it should work fine 在Bridge头文件中设置头,然后运行应用程序,它应该可以正常工作

     #ifndef Bridging_Header_h #define Bridging_Header_h #import <OpenEars/OELanguageModelGenerator.h> #endif 

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM