ios – Xamarin无法编译为本机代码

ios – Xamarin无法编译为本机代码,第1张

概述我试图在Xamarin中使用Good Dynamics SDK,我不太了解Objective-C,所以我在这里有点迷失.这是一个概念证明的尝试,我不确定这是否真的可行. 我已将GD文件从GD.framework目录添加为GD.a,并尝试实现API绑定并从示例XCode项目复制应用程序启动逻辑. 即使Mono Develop以红色显示ApiDefinition的所有内容,我仍然设法让它构建. 构建它 我试图在Xamarin中使用Good Dynamics SDK,我不太了解Objective-C,所以我在这里有点迷失.这是一个概念证明的尝试,我不确定这是否真的可行.

我已将GD文件从GD.framework目录添加为GD.a,并尝试实现API绑定并从示例XCode项目复制应用程序启动逻辑.

即使Mono Develop以红色显示APIDeFinition的所有内容,我仍然设法让它构建.

构建它时是错误日志Full version here的一部分

/Applications/Xcode.app/Contents/Developer/Platforms/iPhonesimulator.platform/Developer/usr/bin/gcc  -Wl,-no_pIE -arch i386 -gDWarf-2 -fobjc-legacy-dispatch -fobjc-abi-version=2 -miphoneos-version-min=6.0 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhonesimulator.platform/Developer/SDKs/iPhonesimulator6.0.sdk  /var/folders/1t/cbdvyj0x4n35m7674l7wvyjc0000gn/T/tmp6df5493a.tmp/main.x86.o -o /var/folders/1t/cbdvyj0x4n35m7674l7wvyjc0000gn/T/tmp6df5493a.tmp/GDTest -framework CFNetwork -framework Foundation -framework GameKit -framework MapKit -framework MediaPlayer -framework MessageUI -framework OpenGLES -framework StoreKit -framework UIKit -framework AddressBookUI -framework SystemConfiguration -framework AddressBook -framework AudioToolBox -framework AVFoundation -framework QuartzCore -framework CoreGraphics -framework CoreLocation -framework MobileCoreServices -framework Security -framework CoreData -framework ExternalAccessory -weak_framework AssetsLibrary -weak_framework Accounts -weak_framework CoreBluetooth -weak_framework CoreTelephony -weak_framework EventKit -weak_framework EventKitUI -weak_framework CoreMotion -weak_framework GLKit -weak_framework iAd -weak_framework NewsstandKit -weak_framework Social -weak_framework Twitter -weak_framework PassKit -weak_framework CoreImage -weak_framework CoreText -weak_framework ImageIO -weak_framework CoreMedia -weak_framework CoreMIDI -weak_framework CoreVIDeo -weak_framework AdSupport -weak_framework QuickLook -lz -u _mono_pmip -u _CreateZStream -u _CloseZStream -u _Flush -u _ReadZStream -u _WriteZStream -liconv -lmono-2.0 -lmonotouch -L/Developer/Monotouch/SDKs/Monotouch.iphonesimulator.sdk/usr/lib -u _catch_exception_raise  -force_load /var/folders/1t/cbdvyj0x4n35m7674l7wvyjc0000gn/T/tmp6df5493a.tmp/GD.a    Undefined symbols for architecture i386:      "std::basic_istream<char,std::char_traits<char> >::gcount() const",referenced from:          GT::AES::decode(std::basic_istream<char,std::char_traits<char> >&,std::basic_ostream<char,unsigned int&,bool)in GD.a(gtaes.o)          GT::AES::encode(std::basic_istream<char,bool)in GD.a(gtaes.o)      "std::basic_string<char,std::char_traits<char>,std::allocator<char> >::find_first_of(char const*,unsigned long,unsigned long) const",referenced from:          -[GDSetPasswordVIEwController checkPasswordStrength:] in GD.a(GDSetPasswordVIEwController.o)          GD::EacpCReq::EacpCReq(std::basic_string<char,std::allocator<char> >,std::basic_string<char,GT::Dbb&)in GD.a(GDEacpCommands.o)          GD::RawSocket::connect()    in GD.a(GDRawSocket.o)      "std::basic_string<char,std::allocator<char> >::copy(char*,referenced from:          GD::Socket::toString() constin GD.a(GDSocket.o)      "std::basic_string<char,std::allocator<char> >::data() const",referenced from:          -[GTContainerDH setRemotePublic521:] in GD.a(GTContainerCrypto.o)          -[GTContainerDH initWithP521] in GD.a(GTContainerCrypto.o)          -[NSData(GTContainerEncryption) GTEncryptedDataUsingDerivedKey:] in GD.a(GTContainerCrypto.o)          -[NSData(GTContainerEncryption) GTDecryptedDataUsingDerivedKey:] in GD.a(GTContainerCrypto.o)          -[GTEncryptedfile streamDIDReceiveData:] in GD.a(GTEncryptedfile.o)          +[NSData(Base64) dataFromBase64String:] in GD.a(NSData+Base64.o)          +[GTJsonCommandProcessor parseNSData:] in GD.a(GTICCJsonCommandProcessor.o)          ...

这种情况持续了很长时间,并且随着错误而结束

ld: symbol(s) not found for architecture i386collect2: ld returned 1 exit statuserror MT5202: Native linking Failed. Please revIEw the build log.

现在我有点卡住了.有任何想法吗?

谢谢

解决方法 ld消息告诉您.a静态库文件不包含i386的代码.需要该架构才能在iOS模拟器上运行代码.

也许GD包为不同的架构提供不同的.a.在这种情况下,您可以使用lipo工具构建一个包含多个体系结构的胖库.

总结

以上是内存溢出为你收集整理的ios – Xamarin无法编译为本机代码全部内容,希望文章能够帮你解决ios – Xamarin无法编译为本机代码所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/web/1056110.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-25
下一篇 2022-05-25

发表评论

登录后才能评论

评论列表(0条)

保存