#1 2023-08-01 15:15:49

JD
Member
Registered: 2015-08-20
Posts: 118

mORMot1 - Lazarus compile error in SynCrossPlatformREST.CallGetResult

Hi there ab,

I have an application that is a GUI application on Linux and a service on Windows. They both work very well.

I want to make a service/daemon on Linux using the same simple service source code that already works on Windows. But when I compile the program, I get the error below:

SynCrossPlatformREST.pas(2918,15) Error: Incompatible types: got "Variant" expected "TID"

/// marshall {result:...,id:...} and {result:...} body answers
function CallGetResult(const aCall: TSQLRestURIParams; var outID: TID): variant;
{$ifndef ISSMS}
var doc: TJSONVariantData;
    jsonres: string;
{$endif}
begin
  ...
  outID := doc.Value['id'];  // <---- Error ocurs here !
  {$endif}
end;           

Someone else has reported the error, but it was erroneously posted in the mORMot2 section here. However no solution to the problem was posted.

My environment
Lazarus; 2.2.6 x86_64-linux-gtk2
FPC; 3.2.2
mORMot; 1.186435

What I find strange is this only occurs when I try to compile the program as a service on Linux. There are no problems at all with the other cases.

Thanks a lot for your assistance.

Cheers,

JD

Offline

#2 2023-08-06 09:46:01

JD
Member
Registered: 2015-08-20
Posts: 118

Re: mORMot1 - Lazarus compile error in SynCrossPlatformREST.CallGetResult

Hi there everyone,

In the end, I decided to rewrite the server app, making sure to remove the dependency on mormot_cross, and I'm pleased to say it now works as expected.

Cheers,

JD

Offline

Board footer

Powered by FluxBB