You are not logged in.
I have a function whose parameter is filled with a json from a request:
function TEventoService.AddColeta(const pAmostraDados: TDTOEventoColeta): TServiceCustomAnswer;
dto:
TDTOEventoColeta:
TDTOEventoColeta = packed record
NumeroAmostra: RawUtf8;
PostoId: Int64;
end;
The json sent:
[{
"NumeroAmostra": "0101",
"PostoId": 1
}]
When I compile this project for Windows64 in Lazarus, and run the application, it works correctly. But if I compile it for Linux64 in Lazarus, the json is not passed to the function.
When I insert an additional property in my dto:
TDTOEventoColeta = packed record
NumeroAmostra: RawUtf8;
PostoId: Int64;
Dummy: RawUtf8;
end;
And I compiled it for Linux64, it passed the json correctly to the function.
Can someone explain to me what happens?
Offline
My guess is that
- you are not using the same version of the FPC compiller and cross-compiller.
- you don't define the record using Rtti.RegisterFromText().
Extended RTTI for records are only available in FPC trunk, not in FPC 3.2.x.
Offline
We are using FPCDeluxe to crosscompile.
What version of lazarus and of fpc we should be choose?
To compile linux and windows from windows machine!
Offline
FPC fixes-3.2 is just fine.
Ensure you use the same version everywhere.
And note that you can have several FPC+Lazarus versions available on the same system.
Just use diverse folders and launch their own shortcut.
Offline