MonoTouch 版本:ld:找不到架构 armv7 的符号 [英] MonoTouch Build: ld: symbol(s) not found for architecture armv7

查看:16
本文介绍了MonoTouch 版本:ld:找不到架构 armv7 的符号的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个 MonoTouch 项目,它在 i386/iOS 模拟器上构建和运行良好.该项目引用了本机 (Obj-C) 库,我使用 Xamarin 的 BindingSample 中所述的 btouch 进​​程将其转换为 MonoTouch DLL:

I have a MonoTouch project which builds and runs fine on i386/iOS Simulator. The project references a native (Obj-C) library, which I converted to a MonoTouch DLL by using the btouch process as described in Xamarin's BindingSample:

https://github.com/xamarin/monotouch-samples/tree/eb60165f0485ff59b2f80e73ccff382bf4f2083/BindingSample/src/binding">https://github.com/xamarin/monotouch-samples/tree/eb60165f0485ff59b2f80e73ccff382/BindingSample/src/binding

所以我的 makefile 构建了所有三个架构(i386、armv6 和 armv7),然后将三个输出组合到一个通用"库中,最后使用 btouch 生成一个 MonoTouch DLL.

So my makefile builds all three architectures (i386, armv6 and armv7), then combines the three outputs to one 'Universal' library, and finally uses btouch to generate a MonoTouch DLL.

为了确保我的通用库包含所有三种架构,我检查了 lipo -info,确实,它包含 i386、armv6 和 armv7.

To be sure that my universal library contains all three architectures, I checked with lipo -info, and indeed, it contains i386, armv6 and armv7.

但是,当我在实际的 iOS 设备上构建部署时,我收到以下错误:

However, when I'm building for deployment on an actual iOS device, I get the following errors:

Undefined symbols for architecture armv7:
  "_ABAddressBookCreate", referenced from:
      -[ContactsTokenField setupSms] in libContactsTokenFieldViewUniversal.a(ContactsTokenField.o)
      -[TITokenFieldView setupWithAddressType:prompt:] in libContactsTokenFieldViewUniversal.a(TITokenField.o)
  "_ABAddressBookCopyArrayOfAllPeople", referenced from:
      -[ContactsTokenField setupSms] in libContactsTokenFieldViewUniversal.a(ContactsTokenField.o)
      -[TITokenFieldView setupWithAddressType:prompt:] in libContactsTokenFieldViewUniversal.a(TITokenField.o)
  "_ABAddressBookGetPersonCount", referenced from:
      -[ContactsTokenField setupSms] in libContactsTokenFieldViewUniversal.a(ContactsTokenField.o)
      -[TITokenFieldView setupWithAddressType:prompt:] in libContactsTokenFieldViewUniversal.a(TITokenField.o)
  "_ABRecordCopyValue", referenced from:
      -[ContactsTokenField setupSms] in libContactsTokenFieldViewUniversal.a(ContactsTokenField.o)
      -[TITokenFieldView setupWithAddressType:prompt:] in libContactsTokenFieldViewUniversal.a(TITokenField.o)
  "_kABPersonFirstNameProperty", referenced from:
      -[ContactsTokenField setupSms] in libContactsTokenFieldViewUniversal.a(ContactsTokenField.o)
      -[TITokenFieldView setupWithAddressType:prompt:] in libContactsTokenFieldViewUniversal.a(TITokenField.o)
      -[ContactsTokenField setupSms] in libContactsTokenFieldViewUniversal.a(ContactsTokenField.o)
      -[TITokenFieldView setupWithAddressType:prompt:] in libContactsTokenFieldViewUniversal.a(TITokenField.o)
  "_kABPersonLastNameProperty", referenced from:
      -[ContactsTokenField setupSms] in libContactsTokenFieldViewUniversal.a(ContactsTokenField.o)
      -[TITokenFieldView setupWithAddressType:prompt:] in libContactsTokenFieldViewUniversal.a(TITokenField.o)
      -[ContactsTokenField setupSms] in libContactsTokenFieldViewUniversal.a(ContactsTokenField.o)
      -[TITokenFieldView setupWithAddressType:prompt:] in libContactsTokenFieldViewUniversal.a(TITokenField.o)
  "_ABMultiValueGetCount", referenced from:
      -[TITokenFieldView setupWithAddressType:prompt:] in libContactsTokenFieldViewUniversal.a(TITokenField.o)
  "_ABMultiValueCopyLabelAtIndex", referenced from:
      -[TITokenFieldView setupWithAddressType:prompt:] in libContactsTokenFieldViewUniversal.a(TITokenField.o)
  "_ABMultiValueCopyValueAtIndex", referenced from:
      -[TITokenFieldView setupWithAddressType:prompt:] in libContactsTokenFieldViewUniversal.a(TITokenField.o)
  "_kABPersonEmailProperty", referenced from:
      -[TITokenFieldView setupWithAddressType:prompt:] in libContactsTokenFieldViewUniversal.a(TITokenField.o)
  "_kABPersonPhoneProperty", referenced from:
      -[TITokenFieldView setupWithAddressType:prompt:] in libContactsTokenFieldViewUniversal.a(TITokenField.o)
ld: symbol(s) not found for architecture armv7
collect2: ld returned 1 exit status

mtouch exited with code 1

我做错了什么?

推荐答案

发现问题:原生库依赖AddressBook框架,忘记在API定义项目的AssemblyInfo.cs中包含:

found the problem: the native library depended on the AddressBook framework, and I forgot to include it in the AssemblyInfo.cs of the API definition project:

[assembly: LinkWith ("libContactsTokenFieldViewUniversal.a", LinkTarget.Simulator | LinkTarget.ArmV6 | LinkTarget.ArmV7, ForceLoad = true, Frameworks="AddressBook Foundation")]

这篇关于MonoTouch 版本:ld:找不到架构 armv7 的符号的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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