4

我正在尝试在 Xamarin 中使用 Good Dynamics SDK,我不太了解 Objective-C,所以我在这里有点迷失。这是一个概念验证的尝试,我不确定这是否真的可行。

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

即使 Mono Develop 以红色显示 ApiDefinition 中的所有内容,我还是设法构建了它。

构建时这是错误日志的一部分 完整版本在这里

/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, std::char_traits<char> >&, unsigned int&, bool)in GD.a(gtaes.o)
          GT::AES::encode(std::basic_istream<char, std::char_traits<char> >&, std::basic_ostream<char, std::char_traits<char> >&, unsigned int&, 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::char_traits<char>, std::allocator<char> >, std::basic_string<char, std::char_traits<char>, std::allocator<char> >, GT::Dbb&)in GD.a(GDEacpCommands.o)
          GD::RawSocket::connect()    in GD.a(GDRawSocket.o)
      "std::basic_string<char, std::char_traits<char>, std::allocator<char> >::copy(char*, unsigned long, unsigned long) const", referenced from:
          GD::Socket::toString() constin GD.a(GDSocket.o)
      "std::basic_string<char, std::char_traits<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 i386
collect2: ld returned 1 exit status

error MT5202: Native linking failed. Please review the build log.

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

谢谢

4

3 回答 3

4

ld消息告诉您.a静态库文件不包含 i386 的代码。该架构是允许您在 iOS 模拟器上运行代码所必需的。

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

于 2012-10-17T16:00:45.310 回答
3

我需要将 -cxx 添加到 iPhone 构建选项中的“其他 mtouch 参数”中。

于 2012-10-18T14:25:20.783 回答
0

这是一个老问题,但经过数小时后,我们在此处详细编写了将 Good Dynamics 与 Xamarin.iOS 结合使用的完整解决方案……需要大约 5 种不同的解决方法。

http://blog.westmonroepartners.com/using-good-dynamics-sdk-v1-8-x-with-xamarin-ios/

于 2014-10-13T21:20:53.320 回答