You are not logged in.
Pages: 1
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
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
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
Thanks, AOG and ab. There's so mutch information that I missed it. I'm using FPC 3.0
Offline
Pages: 1