Binding a native library with Void* as an Input parameter

BamAziziBamAzizi USMember ✭✭
edited September 2016 in Xamarin.iOS

I am binding a native library that has void* as an input in constructor of class and couldn't find anything helpful yet.
here is header file:
@interface AVDataStore : NSObject
{
void swigCPtr;
BOOL swigCMemOwn;
}
-(void
)getCptr;
-(id)initWithCptr: (void)cptr swigOwnCObject: (BOOL)ownCObject;
-(id)initWithDataStorePath: (NSString
)dataStorePath imageExt: (NSString)imageExt audioExt: (NSString)audioExt;

hear is the .cs file generated by sharpie:

// @interface AVDataStore : NSObject
[BaseType(typeof(NSObject))]
interface AVDataStore
{
// -(void *)getCptr;
[Export("getCptr")]

    unsafe void* Cptr { get; }

    // -(id)initWithCptr:(void *)cptr swigOwnCObject:(BOOL)ownCObject;
    [Export("initWithCptr:swigOwnCObject:")]
    unsafe IntPtr Constructor(void* cptr , bool ownCObject);

...

ERROR: .../BTOUCH: Error BI1002: btouch: Unknown kind System.void* cptr in method 'smma.AVDataStore.Constructor' (BI1002)

How can I fix it?

Appreciate your help

Regards
Bam

Tagged:

Answers

  • BamAziziBamAzizi USMember ✭✭

    OK I found a solution (not sure it's the correct one though): I replace void* with class/interface name : in this specific case: unsafe IntPtr Constructor(AVDataStore cptr , bool ownCObject);

Sign In or Register to comment.