Zeos 7 trunk 903 compile FPC 2.4.2 on Linux amd64 x86_64

The alpha/beta tester's forum for ZeosLib 7.0.x series

Report problems concerning our Delphi 2009+ version and new Zeoslib 7.0 features here.

This is a forum that will be removed once the 7.X version goes into stable!!

Moderators: gto, EgonHugeist, olehs

Locked
mario13
Fresh Boarder
Fresh Boarder
Posts: 6
Joined: 06.08.2011, 22:27

Zeos 7 trunk 903 compile FPC 2.4.2 on Linux amd64 x86_64

Post by mario13 »

Trying to compile revision 903 of ZeosDBO trunk (20110806) with Free Pascal Compiler 2.4.2 on Debian GNU/Linux amd64 x86_64 gives errors on ZClasses.pas file like:
Error: No matching Implementation for interface method "IUnknown.QueryInterface (constref TGuid, out <Formal type>) LongInt; Cdecl;"
The problem is due to changes in FPC related to compatibility between platforms: see FPC wiki, and the solution is to edit the ZClasses.pas file like the following patch:

- function QueryInterface({$IFDEF FPC_HAS_CONSTREF}constref{$ELSE}const{$ENDIF} IID: TGUID; out Obj): HResult; {$IFNDEF WINDOWS}cdecl{$ELSE}stdcall{$ENDIF}; virtual;
- function _AddRef: Integer; {$IFNDEF WINDOWS}cdecl{$ELSE}stdcall{$ENDIF};
- function _Release: Integer; {$IFNDEF WINDOWS}cdecl{$ELSE}stdcall{$ENDIF};
+ function QueryInterface({$IFDEF FPC_HAS_CONSTREF}constref{$ELSE}const{$ENDIF} IID: TGUID; out Obj): HResult; {$IF (not defined(WINDOWS)) AND (FPC_FULLVERSION>=20501)}cdecl{$ELSE}stdcall{$IFEND}; virtual;
+ function _AddRef: Integer; {$IF (not defined(WINDOWS)) AND (FPC_FULLVERSION>=20501)}cdecl{$ELSE}stdcall{$IFEND};
+ function _Release: Integer; {$IF (not defined(WINDOWS)) AND (FPC_FULLVERSION>=20501)}cdecl{$ELSE}stdcall{$IFEND};
public
constructor Create(const Controller: IInterface);
property Controller: IInterface read GetController;
@@ -89,7 +93,8 @@
TContainedObject = class(TAggregatedObject, IInterface)
protected
- function QueryInterface({$IFDEF FPC_HAS_CONSTREF}constref{$ELSE}const{$ENDIF} IID: TGUID; out Obj): HResult; {$IFNDEF WINDOWS}cdecl{$ELSE}stdcall{$ENDIF}; override;
+ function QueryInterface({$IFDEF FPC_HAS_CONSTREF}constref{$ELSE}const{$ENDIF} IID: TGUID; out Obj): HResult; {$IF (not defined(WINDOWS)) AND (FPC_FULLVERSION>=20501)}cdecl{$ELSE}stdcall{$IFEND}; override;
end;
{$ENDIF}
@@ -221,7 +226,8 @@
Result := IInterface(FController)._AddRef;
end;
-function TAggregatedObject._Release: Integer; {$IFNDEF WINDOWS}cdecl{$ELSE}stdcall{$ENDIF};
+function TAggregatedObject._Release: Integer; {$IF (not defined(WINDOWS)) AND (FPC_FULLVERSION>=20501)}cdecl{$ELSE}stdcall{$IFEND};
Zoran
Senior Boarder
Senior Boarder
Posts: 55
Joined: 07.05.2010, 22:32

Post by Zoran »

The patch I provided in bugtracker is waiting since december last year to be applied, see:

http://zeosbugs.firmos.at/view.php?id=233
Locked