ios xcode 框架工具包中没有添加头文件
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/16585680/
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
Header files are not added with framework kit in ios xcode
提问by Dolo
I'm so new to xcode, I have a speechkit framework with following files as shown in image below
我是 xcode 的新手,我有一个包含以下文件的语音包框架,如下图所示
Now When I add this framework to my xcode project the header files are shown empty as below
现在,当我将此框架添加到我的 xcode 项目时,头文件显示为空,如下所示
and I end up with build error 'Lexical preprocessor issue SpeechKit/SpeechKit.h' file not found'. What is the issue with it? How to solve this?
我最终得到了构建错误“词法预处理器问题 SpeechKit/SpeechKit.h”文件未找到”。它有什么问题?如何解决这个问题?
采纳答案by Spawnrider
I had the same issue. Your Header symbolic link is corrupted (others too), you must replace it by a valid Symlink.
我遇到过同样的问题。您的 Header 符号链接已损坏(其他也已损坏),您必须将其替换为有效的符号链接。
You can use ln -s command on each Symlink of your framework or use my script available here : https://gist.github.com/spawnrider/6088294#file-fix_symlinks_fmk_ios-sh
您可以在框架的每个符号链接上使用 ln -s 命令,也可以使用我在此处提供的脚本:https: //gist.github.com/spawnrider/6088294#file-fix_symlinks_fmk_ios-sh
回答by mat
Another newbie in Xcode here. I also spent a lot of time with this problem. My scenario is the framework was emailed to me by colleague as a zip file.
Xcode 的另一个新手在这里。我也花了很多时间解决这个问题。我的情况是该框架是同事以 zip 文件的形式通过电子邮件发送给我的。
I unzipped it on windows and copied it to my Mac. Wrong move. I should have unzipped it on the Mac itself. If you are wondering why your "header" is not a folder, then this is your answer.
我在 Windows 上解压缩它并将其复制到我的 Mac。错误的举动。我应该在 Mac 上解压缩它。如果您想知道为什么您的“标题”不是文件夹,那么这就是您的答案。
回答by Jitendra
Your framework wasn't compiled successfully. You need to add the framework to the "Compile Sources" build phase.
您的框架未成功编译。您需要将框架添加到“编译源”构建阶段。
Go to your target's settings and select the 4th tab (Build Phase). Open the "Compile Sources" phase and click on the '+' symbol and add your framework. The lexical/preprocessor issue "'SpeechKit/SpeechKit.h' file not found" should now be solved.
转到目标设置并选择第 4 个选项卡(构建阶段)。打开“编译源”阶段并单击“+”符号并添加您的框架。现在应该解决词法/预处理器问题“'SpeechKit/SpeechKit.h' 文件未找到”。
回答by Tomte
The right answer is, that you have to make sure that the files are compiled right. In my case i had to download the SDK/Framework of my choice again.
正确的答案是,您必须确保文件编译正确。就我而言,我不得不再次下载我选择的 SDK/Framework。
- Delete all files of speechkit in the Project and from the disk
- Download it again from your Source
- Add it to your project
- Make sure you link the Framework (Build Phases->Link Binary with Libraries)
- 删除项目和磁盘中所有speechkit文件
- 从您的来源再次下载
- 将其添加到您的项目中
- 确保链接框架(构建阶段-> 链接二进制与库)
That should make it. I don′t know why it was not compiled proper. But as i followed the steps above, the Framework was compiled right and the Project was built.
那应该可以。我不知道为什么它没有正确编译。但是当我按照上面的步骤进行时,框架被正确编译并构建了项目。
回答by sandy
What i found that if you unzip any downloaded sample code and you get any lexical/preprocessor issue then just simply add that framework again by follow these steps Go to your target's settings and select the 4th tab (Build Phase). Open the "Compile Sources" phase and click on the '+' symbol and add your framework by clicking on (add other from sample code folder) option.
我发现如果您解压缩任何下载的示例代码并且遇到任何词法/预处理器问题,那么只需按照以下步骤再次添加该框架 转到目标设置并选择第 4 个选项卡(构建阶段)。打开“编译源”阶段并单击“+”符号并通过单击(从示例代码文件夹添加其他)选项来添加您的框架。