链接到iphone上的图书馆 [英] linking against a library on iphone

查看:198
本文介绍了链接到iphone上的图书馆的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要链接到libresolv库,并使用它找到我的dns ip。

I need to link against libresolv library , and use it to find my dns ip.

有关如何做的建议吗?

Any advice on how to do that ?

编辑:

如何找到dns ip使用此库? / p>

And how to find dns ip Using this library ?

推荐答案

在Xcode3中,左边你应该有一个名为System Frameworks的文件夹或类似的东西,像Foundation.framework和UIKit.framework。右键单击该文件夹,选择添加>现有框架...,然后从列表中选择libresolv.dylib。

In Xcode3, on the left you should have a folder called "System Frameworks" or something like that were there are already other frameworks like Foundation.framework and UIKit.framework. Right-click on that folder, select "Add > Existing frameworks..." and select "libresolv.dylib" from the list.

>:我终于找到了如何做到这一点在Xcode4 ...在左边,在导航器中,选择最左边的图标(Project,Command-1)。在下面的树中,单击最上面的项目,它是您的项目。接下来,您需要在中心视图的左侧列中选择目标。选择构建阶段选项卡。你现在看到一堆可以展开的项目。展开链接二进制库与库构建阶段,在该框的左下角是一个+按钮(添加项目)。单击,然后从列表中选择libresolv.dylib。 。。比Xcode3,IMHO更难找到。

Edit: I finally found out how to do this in Xcode4... on the left, in the navigator, select the left-most icon (Project, Command-1). In the tree below, click on the top-most item which is your project. Next, you need to select your target in the left column of the center view. Select the "Build Phases" tab. You now see a bunch of items that can be expanded. Expand the "Link Binary With Libraries" build phase, on the lower-left of that box is a "+" button ("Add items"). Click that, then select "libresolv.dylib" from the list. Phew. A lot harder to find than in Xcode3, IMHO.

编辑2 :如果所有你想做的是解决主机名的IP地址那么你不需要链接到libresolv(AFAIK)。请参见 3解决方案中解决主机名的方法,并查看如何在iOS上执行DNS查询

Edit 2: If all you want to do is resolve the IP address of a hostname then you don't need to link libresolv (AFAIK). See 3 Ways to Resolve a Hostname in iOS for solutions and see the question How to perform DNS query on iOS.

这篇关于链接到iphone上的图书馆的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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