移植DTCoreText库以在Xamarin.iOS中使用

时间:2018-06-21 09:33:48

标签: objective-c xamarin.ios static-libraries objective-sharpie

DTCoreText是一个Objective-C库,我想移植它以便在Xamarin中使用。

我已经完成了创建胖静态库以支持通用设备和模拟器的工作,目前我只能使用Objective Sharpie来创建绑定。

构建项目以获取胖库后,我得到4(通常我只有1),这是因为该库正在使用其他库作为引用): libDTAnimatedGIF.a libDTCoreText.a libDTFoundation.a libDTHTMLParser_iOS.a

我只使用 libDTCoreText.a 与我在 Release-iphoneos / usr中找到的头文件一起创建绑定(不确定是否正确) / local / include
Release-iphoneos / DTFoundation 中也有一些不同的标头(我猜它属于 DTFoundation 库),但我不确定该怎么做。用它,所以就把它留下来。
然后,使用以下命令运行Objective Sharpie(版本3.4.23-4cde014和Xcode 9.4):

sharpie bind -output Binding -sdk iphoneos11.4 -scope Headers Headers/*.h -c -IHeaders

以下是日志:

Parsing 62 header files...
In file included from /var/folders/yf/yf65s1l10vv24p22xrf972w80000gp/T/tmp63149b37.h:3:
In file included from /Users/happiness/Desktop/CoreTextLibrary_2/Headers/DTAnchorHTMLElement.h:9:
In file included from Headers/DTHTMLElement.h:16:
Headers/DTHTMLParserNode.h:9:9: fatal error: 'DTFoundation/DTWeakSupport.h' file not found
#import <DTFoundation/DTWeakSupport.h>
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Binding...
  [write] ApiDefinitions.cs
  [write] StructsAndEnums.cs

...

1 error generated.
Error while processing /var/folders/yf/yf65s1l10vv24p22xrf972w80000gp/T/tmp63149b37.h.

Done. Exiting with error code 1.
error: Clang failed to parse input and exited with code 1

即使我有一个错误,但是我仍然可以从Objective-Sharpie获得ApiDefinitions.cs和StructsAndEnums.cs文件。接下来,我将为其创建绑定项目。
在使用ApiDefinition.cs进行验证阶段时,我将更新错误,但就目前而言,我仍然非常想知道我所做的是正确的还是我遗漏了什么?

非常感谢您!

0 个答案:

没有答案