libiconv 未链接到 iOS 项目

发布于 2024-12-05 08:52:34 字数 854 浏览 0 评论 0原文

我正在尝试将 MailCore 编译到我正在制作的 iOS 应用程序中,链接器一直抱怨 libiconv 未链接到至少我认为这是在抱怨。这就是它输出的内容:(

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/)。

我尝试将 libiconv.dylib 添加到“将二进制文件与库链接”,但它根本没有改变错误。

知道这里可能出了什么问题吗?我一直在尝试用 Google 搜索此错误,但找不到有关如何在 libiconv 中链接的任何信息。既然它是iOS SDK的一部分,你会认为我不需要自己编译它吗?

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

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

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

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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

优雅的叶子 2024-12-12 08:52:34

您需要通过“添加框架”添加libiconv.dylib。 SRC 可从此讨论中获取。

You need add libiconv.dylib via "add framework". SRC is available from this discussion.

乖不如嘢 2024-12-12 08:52:34

作为额外确认该库包含在您的目标中,请在 Xcode 左窗格的文件列表中选择该库(假设您已将其添加到您的目标/项目中,您应该会看到框架下列出的框架),然后显示右侧窗格中的助理编辑器视图(视图 -> 助理编辑器 -> 显示助理编辑器)。

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

您应该看到列出的应用程序目标,并且应该选中该目标的复选框。

您可以尝试取消选中并重新选中它,将其推入您的项目中?

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).

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.

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?

朮生 2024-12-12 08:52:34
  • 简单的:
    • 使用Xcode添加引用的框架:libiconv
      • Xcode->选择正确项目Targets-> 构建阶段 -> 将二进制文件与库链接->点击+ ->搜索libiconv ->选择找到的libiconv.tbd
      • “在此处输入图像描述”"
      • “在此处输入图像描述”"
  • 详细信息:我的另一篇帖子答案
  • Simple:
    • use Xcode to add referenced framework: libiconv
      • Xcode->select correct project Targets -> Build Phases -> Link Binary With Libraries-> click + -> search libiconv -> select found libiconv.tbd
      • enter image description here
      • enter image description here
  • detail: my another post answer
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文