在MonoTouch中链接PhoneGap静态库时的未定义符号 [英] Undefined symbols when linking PhoneGap static library in MonoTouch

查看:74
本文介绍了在MonoTouch中链接PhoneGap静态库时的未定义符号的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在努力在MonoTouch的UIWebView中提供PhoneGap功能.我已经测试了Objective C中的功能,并且静态库在那里可以正常工作.但是,当我尝试将PhoneGap静态库链接到我的MonoTouch应用程序中时,会得到一长串未定义的符号.

I am working on providing PhoneGap functionality in a UIWebView in MonoTouch. I have tested the functionality in Objective C and the static library works correctly there. However, when I try and link the PhoneGap static library into my MonoTouch application I get a long list of undefined symbols.

我已经包括了PhoneGap库的所有头文件,并且还确保在编译PhoneGap库时未选中为拇指编译".所以我不确定我缺少什么,错误消息对我来说意义不大.我将在这里引用它们(这是一个很长的列表!),但希望这里的人能使我了解链接器试图告诉我的内容!

I have included all the header files for the PhoneGap library and I have also ensured that 'Compile for thumb' is unchecked when compiling the PhoneGap library. So I am not sure what I am missing and the error messages don't mean much to me. I will quote them here (it is a LONG list!), but hopefully someone here can enlighten me to what the linker is trying to tell me!

这是一长串...

Undefined symbols:
"_ABPersonSetImageData", referenced from:
  -[Contact setFromContactDict:asUpdate:] in libPhoneGap.a(libPhoneGapLib.a-armv6-master.o)
"_kABPersonAddressStateKey", referenced from:
  _kABPersonAddressStateKey$non_lazy_ptr in libPhoneGap.a(libPhoneGapLib.a-armv6-master.o)
 (maybe you meant: _kABPersonAddressStateKey$non_lazy_ptr)
"_kABPersonPhoneHomeFAXLabel", referenced from:
  _kABPersonPhoneHomeFAXLabel$non_lazy_ptr in libPhoneGap.a(libPhoneGapLib.a-armv6-master.o)
 (maybe you meant: _kABPersonPhoneHomeFAXLabel$non_lazy_ptr)
"_kABPersonEmailProperty", referenced from:
  _kABPersonEmailProperty$non_lazy_ptr in libPhoneGap.a(libPhoneGapLib.a-armv6-master.o)
 (maybe you meant: _kABPersonEmailProperty$non_lazy_ptr)
"_kABPersonNoteProperty", referenced from:
  _kABPersonNoteProperty$non_lazy_ptr in libPhoneGap.a(libPhoneGapLib.a-armv6-master.o)
 (maybe you meant: _kABPersonNoteProperty$non_lazy_ptr)
"_kABWorkLabel", referenced from:
  _kABWorkLabel$non_lazy_ptr in libPhoneGap.a(libPhoneGapLib.a-armv6-master.o)
 (maybe you meant: _kABWorkLabel$non_lazy_ptr)
"_kCLLocationAccuracyThreeKilometers", referenced from:
  _kCLLocationAccuracyThreeKilometers$non_lazy_ptr in libPhoneGap.a(libPhoneGapLib.a-armv6-master.o)
 (maybe you meant: _kCLLocationAccuracyThreeKilometers$non_lazy_ptr)
"_OBJC_CLASS_$_CLLocationManager", referenced from:
  objc-class-ref-to-CLLocationManager in libPhoneGap.a(libPhoneGapLib.a-armv6-master.o)
"_kABPersonInstantMessageServiceICQ", referenced from:
  _kABPersonInstantMessageServiceICQ$non_lazy_ptr in libPhoneGap.a(libPhoneGapLib.a-armv6-master.o)
 (maybe you meant: _kABPersonInstantMessageServiceICQ$non_lazy_ptr)
"_kABPersonInstantMessageServiceMSN", referenced from:
  _kABPersonInstantMessageServiceMSN$non_lazy_ptr in libPhoneGap.a(libPhoneGapLib.a-armv6-master.o)
 (maybe you meant: _kABPersonInstantMessageServiceMSN$non_lazy_ptr)
"_kABPersonInstantMessageServiceKey", referenced from:
  _kABPersonInstantMessageServiceKey$non_lazy_ptr in libPhoneGap.a(libPhoneGapLib.a-armv6-master.o)
 (maybe you meant: _kABPersonInstantMessageServiceKey$non_lazy_ptr)
"_kCLLocationAccuracyNearestTenMeters", referenced from:
  _kCLLocationAccuracyNearestTenMeters$non_lazy_ptr in libPhoneGap.a(libPhoneGapLib.a-armv6-master.o)
 (maybe you meant: _kCLLocationAccuracyNearestTenMeters$non_lazy_ptr)
"_kCLLocationAccuracyKilometer", referenced from:
  _kCLLocationAccuracyKilometer$non_lazy_ptr in libPhoneGap.a(libPhoneGapLib.a-armv6-master.o)
 (maybe you meant: _kCLLocationAccuracyKilometer$non_lazy_ptr)
"_UTTypeCopyPreferredTagWithClass", referenced from:
  -[File getMimeTypeFromPath:] in libPhoneGap.a(libPhoneGapLib.a-armv6-master.o)
"_ABPersonCreate", referenced from:
  -[Contact init] in libPhoneGap.a(libPhoneGapLib.a-armv6-master.o)
"_UTTypeCreatePreferredIdentifierForTag", referenced from:
  -[File getMimeTypeFromPath:] in libPhoneGap.a(libPhoneGapLib.a-armv6-master.o)
"_kABPersonPhoneProperty", referenced from:
  _kABPersonPhoneProperty$non_lazy_ptr in libPhoneGap.a(libPhoneGapLib.a-armv6-master.o)
 (maybe you meant: _kABPersonPhoneProperty$non_lazy_ptr)
"_kABPersonInstantMessageUsernameKey", referenced from:
  _kABPersonInstantMessageUsernameKey$non_lazy_ptr in libPhoneGap.a(libPhoneGapLib.a-armv6-master.o)
 (maybe you meant: _kABPersonInstantMessageUsernameKey$non_lazy_ptr)
"_kABOtherLabel", referenced from:
  _kABOtherLabel$non_lazy_ptr in libPhoneGap.a(libPhoneGapLib.a-armv6-master.o)
 (maybe you meant: _kABOtherLabel$non_lazy_ptr)
"_kABPersonBirthdayProperty", referenced from:
  _kABPersonBirthdayProperty$non_lazy_ptr in libPhoneGap.a(libPhoneGapLib.a-armv6-master.o)
 (maybe you meant: _kABPersonBirthdayProperty$non_lazy_ptr)
"_MPMoviePlayerPlaybackDidFinishNotification", referenced from:
  _MPMoviePlayerPlaybackDidFinishNotification$non_lazy_ptr in libPhoneGap.a(libPhoneGapLib.a-armv6-master.o)
 (maybe you meant: _MPMoviePlayerPlaybackDidFinishNotification$non_lazy_ptr)
"_ABMultiValueRemoveValueAndLabelAtIndex", referenced from:
  -[Contact setMultiValueStrings:forProperty:inRecord:asUpdate:] in libPhoneGap.a(libPhoneGapLib.a-armv6-master.o)
  -[Contact setMultiValueDictionary:forProperty:inRecord:asUpdate:] in libPhoneGap.a(libPhoneGapLib.a-armv6-master.o)
"_ABRecordRemoveValue", referenced from:
  -[Contact removeProperty:inRecord:] in libPhoneGap.a(libPhoneGapLib.a-armv6-master.o)
"_ABAddressBookCreate", referenced from:
  -[Contacts newContact:withDict:] in libPhoneGap.a(libPhoneGapLib.a-armv6-master.o)
  -[Contacts displayContact:withDict:] in libPhoneGap.a(libPhoneGapLib.a-armv6-master.o)
  -[Contacts search:withDict:] in libPhoneGap.a(libPhoneGapLib.a-armv6-master.o)
  -[Contacts save:withDict:] in libPhoneGap.a(libPhoneGapLib.a-armv6-master.o)
  -[Contacts remove:withDict:] in libPhoneGap.a(libPhoneGapLib.a-armv6-master.o)
"_ABMultiValueCopyValueAtIndex", referenced from:
  -[Contact setMultiValueStrings:forProperty:inRecord:asUpdate:] in libPhoneGap.a(libPhoneGapLib.a-armv6-master.o)
  -[Contact setMultiValueDictionary:forProperty:inRecord:asUpdate:] in libPhoneGap.a(libPhoneGapLib.a-armv6-master.o)
  -[Contact extractMultiValue:] in libPhoneGap.a(libPhoneGapLib.a-armv6-master.o)
  -[Contact extractAddresses] in libPhoneGap.a(libPhoneGapLib.a-armv6-master.o)
  -[Contact extractIms] in libPhoneGap.a(libPhoneGapLib.a-armv6-master.o)
"_OBJC_CLASS_$_AVAudioPlayer", referenced from:
  objc-class-ref-to-AVAudioPlayer in libPhoneGap.a(libPhoneGapLib.a-armv6-master.o)
"_kABHomeLabel", referenced from:
  _kABHomeLabel$non_lazy_ptr in libPhoneGap.a(libPhoneGapLib.a-armv6-master.o)
 (maybe you meant: _kABHomeLabel$non_lazy_ptr)
"_kABPersonInstantMessageProperty", referenced from:
  _kABPersonInstantMessageProperty$non_lazy_ptr in libPhoneGap.a(libPhoneGapLib.a-armv6-master.o)
 (maybe you meant: _kABPersonInstantMessageProperty$non_lazy_ptr)
"_kABPersonAddressZIPKey", referenced from:
  _kABPersonAddressZIPKey$non_lazy_ptr in libPhoneGap.a(libPhoneGapLib.a-armv6-master.o)
 (maybe you meant: _kABPersonAddressZIPKey$non_lazy_ptr)
"_ABPersonRemoveImageData", referenced from:
  -[Contact setFromContactDict:asUpdate:] in libPhoneGap.a(libPhoneGapLib.a-armv6-master.o)
  -[Contact setFromContactDict:asUpdate:] in libPhoneGap.a(libPhoneGapLib.a-armv6-master.o)
"_kABPersonAddressProperty", referenced from:
  _kABPersonAddressProperty$non_lazy_ptr in libPhoneGap.a(libPhoneGapLib.a-armv6-master.o)
 (maybe you meant: _kABPersonAddressProperty$non_lazy_ptr)
"_OBJC_CLASS_$_MPMoviePlayerController", referenced from:
  objc-class-ref-to-MPMoviePlayerController in libPhoneGap.a(libPhoneGapLib.a-armv6-master.o)
"_kABPersonInstantMessageServiceYahoo", referenced from:
  _kABPersonInstantMessageServiceYahoo$non_lazy_ptr in libPhoneGap.a(libPhoneGapLib.a-armv6-master.o)
 (maybe you meant: _kABPersonInstantMessageServiceYahoo$non_lazy_ptr)
ld: symbol(s) not found
collect2: ld returned 1 exit status
Process exited with code 1

希望这对这里的某人有意义,因为它对我来说很希腊! ;)

Hope this makes sense to someone here, because it is greek to me! ;)

谢谢

推荐答案

我发现了问题;我缺少PhoneGap库所需的几个框架条目.具体来说,这些框架条目需要添加到gcc_flags中:

I found the problem; I was missing several framework entries that were required by the PhoneGap library. Specifically, these framework entries needed to be added to the gcc_flags:

-framework corelocation 
-framework mediaplayer
-framework messageui
-framework mobilecoreservices
-framework quartzcore
-framework systemconfiguration
-framework audiotoolbox
-framework avfoundation
-framework addressbook
-framework foundation
-framework coregraphics
-framework addressbookui

这篇关于在MonoTouch中链接PhoneGap静态库时的未定义符号的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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