[fpc-pascal] Unable to compile JSON SuperObject on FPC 2.5.1

Fred Flinestone ffred69 at gmail.com
Wed Nov 10 11:48:38 CET 2010


Hello all,

I am not able to compile JSON – SuperObject where compiler says this:

.../superobject.pas(135,18) Error: No matching implementation for
interface method "IUnknown.QueryInterface(constref TGuid,out <Formal
type>):LongInt; CDecl;" found
.../superobject.pas(135,18) Error: No matching implementation for
interface method "IUnknown._AddRef:LongInt; CDecl;" found
.../superobject.pas(135,18) Error: No matching implementation for
interface method "IUnknown._Release:LongInt; CDecl;" found
800 195.830/200.608 Kb Used
.../superobject.pas(835,1) Fatal: There were 3 errors compiling module, stopping

The definition of these function is:

  TSuperObject = class(TObject, ISuperObject)
    ...
    function QueryInterface(const IID: TGUID; out Obj): HResult;
virtual; stdcall;
    function _AddRef: Integer; virtual; stdcall;
    function _Release: Integer; virtual; stdcall;

then I found that IUnknown has different declaration and therefore I
made this correction:

    function QueryInterface(const IID: TGUID; out Obj): LongInt; virtual; cdecl;
    function _AddRef: LongInt; virtual; cdecl;
    function _Release: LongInt; virtual; cdecl;

not it stopped to write the error for _AddRef and _Release, but to
QueryInterface is still the same error present.

What could be a solution?

Thanks in advance.

Fred.



More information about the fpc-pascal mailing list