Such operators do not work in mode delphi. Use mode objfpc. But the delphi code should work in mode delphi, so simply leave out the + overload will work.
Simply use class operator TPoint2px.Add(const a, b: TPoint2px): TPoint2px; and use mode delphi.
Alternatively
class operator TPoint2px.+(const a, b: TPoint2px): TPoint2px; in mode objfpc should work, provided {$modeswitch advancedrecords} is active.
So:
{$ifdef fpc}
class operator + (const a, b: TPoint2px) c: TPoint2px; //when using mode objfpc
{$else}
class operator TPoint2px.Add(const a, b: TPoint2px): TPoint2px; //when using mode delphi
{$endif}
begin
Result.x:= a.x + b.x;
Result.y:= a.y + b.y;
end;