#1 2016-01-20 13:34:34

jkuiper
Member
Registered: 2014-11-24
Posts: 13

syncrosplatform.pas: eroor function setProperty

I'm trying sample 27, which using crosplatform. first I compiled it in Delphi. Works okay.
Now I'm compiling the fpc version, but get a compiler error:

    {$ifdef FPC_VARIANTSETVAR} // see [url]http://mantis.freepascal.org/view.php?id=26773[/url]
    function SetProperty(var V: TVarData; const Name: string;
      const Value: TVarData): Boolean; override;
    {$else}
-->    function SetProperty(const V: TVarData; const Name: string;
      const Value: TVarData): Boolean; override;
    {$endif}                                  

Compile Project, Target: LCLClient.exe: Exit code 1, Errors: 2
SynCrossPlatformJSON.pas(224,14) Error: function header doesn't match the previous declaration "SetProperty(const tvardata;const AnsiString;const tvardata):Boolean;"
Error: Found declaration: SetProperty(var tvardata;const AnsiString;const tvardata):Boolean;

Changing the const to var in the class was the solution. Please change it in trunk.

Offline

#2 2016-01-20 16:27:10

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,659
Website

Re: syncrosplatform.pas: eroor function setProperty

Which version of FPC are you using?

Take a look at the comments about FPC_VARIANTSETVAR in Synopse.inc:

    // defined if the http://mantis.freepascal.org/view.php?id=26773 bug is fixed
    // you should use 2.7.1/trunk branch in revision 28995 from 2014-11-05T22:17:54
    // => this will change the TInvokeableVariantType.SetProperty() signature
    {$define FPC_VARIANTSETVAR}

Offline

#3 2016-01-21 07:28:04

AOG
Member
Registered: 2014-02-24
Posts: 490

Re: syncrosplatform.pas: eroor function setProperty

Sample 27, LCL client uses {$i SynCrossPlatform.inc}
Inside SynCrossPlatform.inc, there is : {$ifdef VER2_7_1}
If you change this in {$ifdef VER3}, then everything is ok !

Offline

#4 2016-01-21 08:12:50

jkuiper
Member
Registered: 2014-11-24
Posts: 13

Re: syncrosplatform.pas: eroor function setProperty

Thanks, AOG and ab. There's so mutch information that I missed it. I'm using FPC 3.0

Offline

Board footer

Powered by FluxBB