我试图弄清楚如何为我拥有的静态库创建一个工作绑定项目。我们自己没有创建静态库,但我们有权使用它。
我尝试按照此页面上的步骤取得成功:https://developer.xamarin.com/guides/ios/advanced_topics/binding_objective-c/walkthrough/
基本上发生的事情是,当运行命令' sharpie bind --sdk = iphoneos9.3 * .a'我得到了一个错误列表(见帖子的底部) 所以在玩了几个小时后,我决定阅读ApiDefinition。显然,上面链接的指南中描述的过程已弃用,我应该将.a文件添加为本机参考。
根据ApiDefinition中的注释,我们必须手动创建绑定。问题是,我不知道库中的方法名称。此外,即使我这样做,库也很庞大(我们桌面版的头文件已经是36k行了。)
有人可以告诉我们如何继续吗?
sharpie命令的错误列表:
Macbook-Pro:iossdk researchdevelopment$ sharpie bind --sdk=iphoneos9.3 libHCNetSDK_sim.a
Parsing 1 header files...
warning: /Users/researchdevelopment/Desktop/iossdk/libHCNetSDK_sim.a: 'linker' input unused
warning: argument unused during compilation: '-c'
warning: argument unused during compilation: '-fno-spell-checking'
warning: argument unused during compilation: '-Xclang -detailed-preprocessing-record'
warning: argument unused during compilation: '-isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.3.sdk'
warning: argument unused during compilation: '-D NS_BUILD_32_LIKE_64'
warning: argument unused during compilation: '-miphoneos-version-min=9.3'
warning: argument unused during compilation: '-I /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include'
warning: argument unused during compilation: '-I /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1'
error: unable to handle compilation, expected exactly one compiler job in ''
Error while processing /Users/researchdevelopment/Desktop/iossdk/libHCNetSDK_sim.a.
Submitting usage data to Xamarin...
Submitted - thank you for helping to improve Objective Sharpie!
Done. Exiting with error code 1.
error: Clang failed to parse input and exited with code 1
答案 0 :(得分:0)
我不相信你可以将.a文件传递给Objective Sharpie。当我上次构建一个绑定项目时,我跟着this guide。
大约一半时间,有一个例子说明如何运行Objective Sharpie来生成绑定,它只传递头文件,而不是编译的二进制文件。