Sharpie failed: "Unable to handle compilation, expected exactly one compiler job''"

I tried to use sharpies to convert a library ".a" into Binding Library but I have some error. The command that I have executed is:

sharpie bind -v -output=[...] --namespace=[...] --sdk=iphoneos11.0 lib.a

and the errors returned are:

Error: unable to handle compilation, expected exactly one compiler job in ''
Error while processing /Users/federicopieri/Desktop/GPDL/libMSSUniversal.a.

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

Can U help me?

THX

Best Answers

  • Gigi74Gigi74 ITMember ✭✭
    Accepted Answer

    I solved creating a file "linkwith.cs" inside the iOS Binding Library. This file contains the correct linker flags.

Answers

  • MatthewNoelMatthewNoel USMember ✭✭

    Any luck with this? I'm having a similar problem with a ".a" library file.

  • Gigi74Gigi74 ITMember ✭✭

    Perhaps we need the header (.h) files for using Sharpie :(

  • ChrisvanwykChrisvanwyk USXamarin Team, University, XamUProfessors, Developer Group Leader Xamurai

    Objective-Sharpie inspect and parse header files and does not parse static libraries.

    My suggestion would be to rewrite your command like this assuming you have an umbrella header file called lib.h :

    sharpie bind -output MyOutPutFolder -namespace MyBindingNameSpace -sdk iphoneos11.0 lib.h

  • Gigi74Gigi74 ITMember ✭✭
    edited November 16

    I have the .h files but if I use ths file created by Sharpie in Visual Studio I get a lot of error.... Help ME !!!!!!!
    Attached the header files.

  • ChrisvanwykChrisvanwyk USXamarin Team, University, XamUProfessors, Developer Group Leader Xamurai

    Hi @Gigi74

    Without the compiled library not much more to do here, however running this following command inside the folder containing the header files

    sharpie bind -output OutPut -namespace XamarinAuthOTP -sdk iphoneos11.1 AuthOTP.h -scope .

    creates an ApiDefinitions.cs with 4 MethodToProperty verify attributes. Clean these up and you should be ok. It might help if you post the errors you ran into.

    I would also suggest having a look at this page
    https://developer.xamarin.com/guides/cross-platform/macios/binding/objective-sharpie/platform-features/verify/

  • Gigi74Gigi74 ITMember ✭✭
    edited November 16

    GREAT !!! You are a saint.
    "-scope" parameter is fundamental :).

    Now I have one static class "authOTP". Can I use the static class or it's convenient
    have a "normal" class?

  • Gigi74Gigi74 ITMember ✭✭
    edited November 17

    I tried to use the binding library in a Xamarin.Forms project but I have 44 error during the project build:
    4> Undefined symbols for architecture x86_64:
    4> "_xmlAddChild", referenced from:
    4> +[GDataXMLNode elementWithName:stringValue:] in libMSSUniversal.a(GDataXMLNode.o)
    4> -[GDataXMLElement addChild:] in libMSSUniversal.a(GDataXMLNode.o)
    4> "_xmlBufferContent", referenced from:
    4> -[GDataXMLNode XMLString] in libMSSUniversal.a(GDataXMLNode.o)
    4> "_xmlBufferCreate", referenced from:
    4> -[GDataXMLNode XMLString] in libMSSUniversal.a(GDataXMLNode.o)
    4> "_xmlBufferFree", referenced from:
    4> -[GDataXMLNode XMLString] in libMSSUniversal.a(GDataXMLNode.o)
    4> "_xmlBufferLength", referenced from:
    4> -[GDataXMLNode XMLString] in libMSSUniversal.a(GDataXMLNode.o)
    .....

    If I execute the "Lipo" command on my native library (.a) I get the following result:
    "Armv7 i386 x86_64 arm64"

    I executed also command "nm -arch x86_64 libMSSUniversal.a" and I found that the symbol are undefined:

    00000000000054c0 D _kGDataXMLXPathDefaultNamespacePrefix
    U _memcpy
    U _memset
    U _objc_enumerationMutation
    U _objc_msgSend
    U _objc_msgSendSuper2
    U _strlen
    U _xmlAddChild
    U _xmlBufferContent
    U _xmlBufferCreate
    U _xmlBufferFree
    U _xmlBufferLength
    U _xmlCopyNode
    U _xmlDocDumpMemory
    U _xmlDocGetRootElement
    .....

    How can I resolve this problem?

  • Gigi74Gigi74 ITMember ✭✭
    Accepted Answer

    I solved creating a file "linkwith.cs" inside the iOS Binding Library. This file contains the correct linker flags.

Sign In or Register to comment.