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};
Zeos 7 trunk 903 compile FPC 2.4.2 on Linux amd64 x86_64
Moderators: gto, EgonHugeist, olehs
The patch I provided in bugtracker is waiting since december last year to be applied, see:
http://zeosbugs.firmos.at/view.php?id=233
http://zeosbugs.firmos.at/view.php?id=233