2012-06-19 50 views
6

我有一個MonoTouch項目,它在i386/iOS模擬器上構建並運行良好。該項目引用本地(對象 - )庫,我轉換爲MonoTouch的DLL使用btouch過程中Xamarin的BindingSample描述:MonoTouch Build:ld:未找到架構armv7的符號

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

所以我的makefile構建三個體系結構(i386,ARMv6的和armv7),然後將三個輸出結合到一個「Universal」庫中,最後使用btouch生成MonoTouch DLL。爲了確保我的通用庫包含所有三種體系結構,我使用了lipo -info,事實上它包含了i386,armv6和armv7。

然而,當我建立一個用於部署的實際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 

我在做什麼錯?

回答

8

發現了問題:本地庫依賴於通訊錄框架,我忘了,包括它的API定義項目的AssemblyInfo.cs:

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

哇,我幾乎放棄了。謝謝! –

+0

經過漫長而痛苦的搜索,這些信息讓我走上了正確的軌道。謝謝。 – Aranda

相關問題