Unable to compile JSON SuperObject on FPC 2.5.1

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Unable to compile JSON SuperObject on FPC 2.5.1

Fred Flinestone
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.
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Unable to compile JSON SuperObject on FPC 2.5.1

Jonas Maebe-2

On 10 Nov 2010, at 11:48, Fred Flinestone wrote:

> 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?

http://wiki.freepascal.org/User_Changes_Trunk#IInterface.QueryInterface.2C_._AddRef_and_._Release_definitions_have_been_changed


Jonas
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Unable to compile JSON SuperObject on FPC 2.5.1

Michael Van Canneyt
In reply to this post by Fred Flinestone


On Wed, 10 Nov 2010, Fred Flinestone wrote:

> 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?
The declaration of the IUnknown has been changed on non-windows platforms
to be XP-COM compatible. You can copy the new definition from the system
unit, file rtl/inc/objpash.inc. It's just a matter of adding some ifdefs to
the declaration. The code inside should function OK.

Michael.
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Unable to compile JSON SuperObject on FPC 2.5.1

Fred Flinestone
In reply to this post by Jonas Maebe-2
Thanks.

On Wed, Nov 10, 2010 at 11:56 AM, Jonas Maebe <[hidden email]> wrote:

>
> On 10 Nov 2010, at 11:48, Fred Flinestone wrote:
>
>> 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?
>
> http://wiki.freepascal.org/User_Changes_Trunk#IInterface.QueryInterface.2C_._AddRef_and_._Release_definitions_have_been_changed
>
>
> Jonas
> _______________________________________________
> fpc-pascal maillist  -  [hidden email]
> http://lists.freepascal.org/mailman/listinfo/fpc-pascal
>
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

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

José Mejuto
In reply to this post by Michael Van Canneyt
Hello FPC-Pascal,

Wednesday, November 10, 2010, 11:57:52 AM, you wrote:

>>    function QueryInterface(const IID: TGUID; out Obj): HResult;
>> virtual; stdcall;
MVC> The declaration of the IUnknown has been changed on non-windows platforms
MVC> to be XP-COM compatible. You can copy the new definition from the system
MVC> unit, file rtl/inc/objpash.inc. It's just a matter of adding some ifdefs to
MVC> the declaration. The code inside should function OK.

But also in Windows, QueryInterface has been changed to constref, so
something like Zeos 6.6 needs an adjust before compile succesfully. Is
this expected ?

--
Best regards,
 José

_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

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

Michael Van Canneyt


On Wed, 10 Nov 2010, José Mejuto wrote:

> Hello FPC-Pascal,
>
> Wednesday, November 10, 2010, 11:57:52 AM, you wrote:
>
>>>    function QueryInterface(const IID: TGUID; out Obj): HResult;
>>> virtual; stdcall;
> MVC> The declaration of the IUnknown has been changed on non-windows platforms
> MVC> to be XP-COM compatible. You can copy the new definition from the system
> MVC> unit, file rtl/inc/objpash.inc. It's just a matter of adding some ifdefs to
> MVC> the declaration. The code inside should function OK.
>
> But also in Windows, QueryInterface has been changed to constref, so
> something like Zeos 6.6 needs an adjust before compile succesfully. Is
> this expected ?
I don't think so, this should be asked to Joost van der sluis.

Michael.
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Unable to compile JSON SuperObject on FPC 2.5.1

lguzzon
This post has NOT been accepted by the mailing list yet.
In reply to this post by Fred Flinestone
Hi,
here there is my solution as a code pacth ... (Works in FPC [WIN32, Linux32], Delphi)
superobject_lg.patch