简体   繁体   English

MonoTouch Build:ld:未找到架构armv7的符号

[英]MonoTouch Build: ld: symbol(s) not found for architecture armv7

I have a MonoTouch project which builds and runs fine on i386/iOS Simulator. 我有一个MonoTouch项目,可以在i386 / iOS模拟器上构建和运行。 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: 该项目引用了一个本机(Obj-C)库,我通过使用Xamarin的BindingSample中描述的btouch进程将其转换为MonoTouch DLL:

https://github.com/xamarin/monotouch-samples/tree/eb640165f0485ff59b2f80e73ccff382bf4f2083/BindingSample/src/binding https://github.com/xamarin/monotouch-samples/tree/eb640165f0485ff59b2f80e73ccff382bf4f2083/BindingSample/src/binding

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. 所以我的makefile构建了所有三种架构(i386,armv6和armv7),然后将三个输出组合到一个'Universal'库中,最后使用btouch生成MonoTouch DLL。

To be sure that my universal library contains all three architectures, I checked with lipo -info , and indeed, it contains i386, armv6 and armv7. 为了确保我的通用库包含所有三种体系结构,我使用lipo -info进行了检查,实际上它包含了i386,armv6和armv7。

However, when I'm building for deployment on an actual iOS device, I get the following errors: 但是,当我在实际的iOS设备上进行部署时,我会收到以下错误:

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

What am I doing wrong? 我究竟做错了什么?

发现问题:本地库依赖于AddressBook框架,我忘了将它包含在API定义项目的AssemblyInfo.cs中:

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM