libiconv没有链接到iOS项目 [英] libiconv not linking to iOS project

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

问题描述

我正在尝试将 MailCore 编译到我正在制作的iOS应用中,并且链接器一直抱怨libiconv不是'我联系在一起。至少我认为这是抱怨的。这是它吐出的内容:

I'm trying to compile MailCore into an iOS app I'm making, and the linker keeps complaining that libiconv isn't linked in. At least that's what I think it's complaining about. This is what it spits out:

Undefined symbols for architecture i386:
  "_iconv", referenced from:
      _mail_iconv in libmailcore.a(charconv.o)
  "_iconv_open", referenced from:
      _charconv in libmailcore.a(charconv.o)
      _charconv_buffer in libmailcore.a(charconv.o)
  "_iconv_close", referenced from:
      _charconv in libmailcore.a(charconv.o)
      _charconv_buffer in libmailcore.a(charconv.o)
ld: symbol(s) not found for architecture i386
collect2: ld returned 1 exit status

(这是为为我的iPhone构建同样的错误,但 s / i386 / armv7 / )。

(This is building for the simulator. Building for my iPhone gives the same error, but s/i386/armv7/).

I我已经尝试将 libiconv.dylib 添加到Link Binary with Libraries,但它根本不会改变错误。

I've tried adding libiconv.dylib to "Link Binary with Libraries", but it doesn't change the errors at all.

知道这里有什么不对吗?我一直在尝试谷歌这个错误,但我找不到任何有关如何链接在libiconv的信息。既然它是iOS SDK的一部分,你会认为我不需要自己编译吗?

Any idea what could be wrong here? I've been trying to Google this error, but I can't find any information about how to link in libiconv. Since it's part of the iOS SDK, you would think I shouldn't need to compile it myself?

推荐答案

作为额外的确认lib包含在你的目标中,在Xcode左侧窗格的文件列表中选择lib(假设你已经将它添加到你的Target / Project,你应该看到框架下列出的框架),并显示Assistant Editor视图在右侧窗格中(查看 - >助理编辑器 - >显示助理编辑器)。

As extra confirmation that the lib is included in your target, select the lib in the file list in the left pane of Xcode (assuming you've added it to your Target / Project, you should see the framework listed under frameworks), and show the Assistant Editor view on the right pane (View -> Assistant Editor -> Show Assistant Editor).

然后,在左侧选择相关的库,您将看到目标成员资格对于该lib显示为右侧的复选框列表。

Then, with the relevant lib selected on the left, you will see 'Target Membership' for that lib shown as a list of checkboxes on the right.

您应该看到App Target Listed,并且应该检查该目标的复选框。

You should see App Target Listed, and the checkbox should be checked for that target.

您可以尝试取消选中并重新检查它,将其轻推到您的项目中吗?

You could try unchecking and rechecking it, to nudge it into your project?

这篇关于libiconv没有链接到iOS项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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