Xcode无法导入Tapku或Kal库 [英] Xcode cannot import tapku or kal library

查看:100
本文介绍了Xcode无法导入Tapku或Kal库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我无法导入tapku库(要使用它提供的日历api).我也尝试过Kal遇到同样的问题.这是我要导入的操作(请告诉我是否缺少某些东西)(使用Xcode 4.5).

I am having trouble importing the tapku library (to use the calendar api it provides). I've also tried Kal with the same problem. Here's what I do to import it (please tell me if I'm missing something) (using Xcode 4.5).

  1. 转到文件>将文件添加到项目中> TapkuLibrary.xcodeproj>未选中将项目复制到目标的组文件夹中,选择了创建文件夹引用,然后将其添加到目标我的项目"中.

  1. Go file > Add files to project > TapkuLibrary.xcodeproj > copy items into destination's group folder unchecked, Create folder references selected, add to target "my project" checked.

转到文件>将文件添加到项目> TapkuLibrary.bundle>与上面相同的设置.

Go file > Add files to project > TapkuLibrary.bundle > same settings as above.

在构建设置下的标题搜索路径"下,将文件添加到tapku库"src"文件夹中(并保留左侧的复选框为未选中状态). 我在标题搜索路径中的项目中也使用了其他API的另一个项目.这有关系吗?

Under build settings, under "header search paths", add the file to the tapku library "src" folder (and leave the box on the left unchecked). I have another item from a different api i used in my project in header search paths, too. Does this matter?

转到构建阶段,然后在目标依赖项下添加Tapku库,并在使用库链接二进制文件"下添加libTapkuLibrary.a.

Go to build phases, and add Tapku Library under target dependencies and libTapkuLibrary.a under Link binary with libraries.

因此,执行完此操作后,当我进入项目中的文件并尝试

So after doing this, when I go to a file in my project and try

#import <TapkuLibrary/TapkuLibrary.h>

显示找不到TapkuLibrary.h文件"

It says "TapkuLibrary.h file not found"

顺便说一下,Tapku文件夹本身在我的桌面上,而不是在应用程序的根文件夹中.

By the way, the Tapku folder itself is on my desktop, not in the application's root folder.

请告诉我我是否缺少某些东西或做错了什么. 太感谢了! 卢克

Please tell me if I am missing something or doing something wrong. Thank you so much! Luke

推荐答案

为您列出的步骤使用相同的数字:

Using the same numbers for the steps you listed:

1)正确-请勿复制项目.

1) Correct - do not copy the project.

2)我通常不必为包含的库执行此操作,但是对于此框架,也许您需要这样做(我假设已经被告知要执行此操作)

2) I don't normally have to do this for included libraries but perhaps you need this for this framework (I assume you've been told to do this)

3)标头搜索路径必须与从外壳程序使用的字符串相同,以从项目所在的目录获取要查找的思维的顶层文件夹(目录).在您的情况下,它是TapkuLibrary文件夹.您的路径可以相对于项目所在的目录:

3) The header search path has to be the same string you would use from the shell to get from the directory your project is in to the top level folder (directory) of the think you want to find. In your case, it is a folder TapkuLibrary. Your path can be relative to the directory the project is in:

./../../../Foo/Goop/TapkuLibrary

或者它可以是绝对路径:

or it can be an absolute path:

/Users/jfk/Desktop/TapuLibrary

因此找出您认为正确的字符串,然后打开Terminal,将cd转到您的项目文件所在的目录,然后键入"ls"并查看它是否列出了目录的内容.如果没有,请找出您做错了什么.

So figure out the string you think is correct, then open Terminal, cd to the directory where your project file is, then type "ls " and see if it lists the contents of the directory. If not, then figure out what you did wrong.

设置递归"标志可能是一个好主意-如果双击标题搜索路径",则可以选择左侧的框(或者可以在路径中键入"/**"后缀)

Its probably a good idea to set the "recursive" flag - if you double click on Header Search Paths, you can select the box on the left (or you can type in a "/**" postfix to the path).

4)请勿使用:

#import <TapkuLibrary/TapkuLibrary.h>

这告诉Xcode这是一个System文件夹(在/usr/include中),等等.按照您使用它的方式,它应该是一个用户文件夹:

That is telling Xcode that this is a System folder (in /usr/include), etc. In the manner you are using this it should be a user folder:

#import "TapkuLibrary/TapkuLibrary.h"

这篇关于Xcode无法导入Tapku或Kal库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆