在Xcode中安装像libical这样的库的帮助 [英] Help on installing a library like libical into Xcode

查看:93
本文介绍了在Xcode中安装像libical这样的库的帮助的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在我的项目中使用libical库,但我从来没有使用过外部库。我已经下载了libical文件,但我几乎卡在那里。我不怎么样,甚至如果,我需要构建/提取它们,然后如何让他们进入Xcode。任何帮助将非常感谢。谢谢。

解决方案

如果这是一个预构建库,那么你可以将它拖到你的Xcode项目c / c> c $ c> c $ c> Project => 添加到项目... b
$ b

如果它不是预构建的,那么你需要构建你想要定位的任何环境和架构。如果它有一个Xcode项目,那么这很容易。如果它只是通常的开源类型的分发,那么你通常做这样的事情:

  $ ./configure 
$ ./make
$ sudo ./make install

(/ usr / local / lib 和 / usr / local / include 。在你的主Xcode项目中,你可以只是添加这些头和库文件到你的项目。



注意,如果你是交叉编译,例如。对于iPhone,那么您需要向 ./ configure 命令中添加一些标志,以便定位正确的体系结构。 ./ configure -build = arm-apple-darwin9.0.0d1



请注意,想要检查 MacPorts ,看看他们是否已经修复了Mac OS X的给定开源项目 - 此



另请参阅此博客关于在iPhone上构建和使用libical


I would like to use the libical library in my project, but I have never used an external library before. I have downloaded the libical files, but I am pretty much stuck there. I do not how how, or even if, I need to build/extract them and then how to get them into Xcode. Any help would be greatly appreciated. Thank you.

解决方案

If this a pre-built library then you can just drag it into your Xcode project (or use Project => Add to Project…) in the same way that you would for source/header files.

If it's not pre-built then you'll need to build it for whatever environments and architecture you want to target. If it comes with an Xcode project then this is easy. If it's just the usual open source type of distribution then you usually do something like this:

$ ./configure
$ ./make
$ sudo ./make install

That will typically put the built library(ies) and header(s) into somewhere like /usr/local/lib and /usr/local/include. In your main Xcode project you can then just add these header(s) and library(ies) to your project.

Note that if you're cross-compiling, e.g. for iPhone, then you'll need to add some flags to the ./configure command so that you target the correct architecture, e.g. ./configure -build=arm-apple-darwin9.0.0d1.

Note also that it's usually a good idea to check MacPorts to see if they have already fixed up a given open source project for Mac OS X - this can save you a lot of work.

See also this blog about building and using libical on iPhone.

这篇关于在Xcode中安装像libical这样的库的帮助的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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