Need help for porting DTCoreText library to Xamarin

Happin3ssHappin3ss USMember ✭✭

FYI, DTCoreText is an objective-C library and I want to port it for using in Xamarin.
I've done with creating fat static library for supporting generic devices and simulator and currently I'm stuck at using Objective Sharpie for create binding.
After build the project to get fat library, I got 4 (normally I just get 1, I guess It's because this library are using other libraries as references): libDTAnimatedGIF.a, libDTCoreText.a, libDTFoundation.a and libDTHTMLParser_iOS.a
I only take libDTCoreText.a for creating the binding (not sure It's correct or not) together with header files I found in Release-iphoneos/usr/local/include. There are also some different headers in Release-iphoneos/DTFoundation (which I guess belong to DTFoundation library) but I'm not sure what to do with it so just leave it behind. Then I run Objective Sharpie with the below command:
sharpie bind -output Binding -sdk iphoneos11.4 -scope Headers Headers/*.h -c -IHeaders

Here are the log:

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>

  [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

Even I have an error But I still can get the ApiDefinitions.cs and StructsAndEnums.cs files from Objective-Sharpie. Next, I will create binding project for it.
I will update the error when I'm doing verify phase with ApiDefinition.cs but for now, I'm still very wondering about What I've done is correct or Did I missing something ?

Thank you so much !


  • Happin3ssHappin3ss USMember ✭✭

    Some additional information:

    • DTCoreText repository :
    • I'm using Objective Sharpie 3.4.23-4cde014 with Xcode 9.4
Sign In or Register to comment.