Recent

Author Topic: Strange error after updating Lazarus/FPC  (Read 149 times)

MISV

  • Hero Member
  • *****
  • Posts: 701
Strange error after updating Lazarus/FPC
« on: September 23, 2020, 12:36:35 pm »
I am using this version:
- Version 2.1.0
- Date: 2020-09-13
- FPC Version: 3.3.1
- SVN Revision: 63882
- X86-64-darwin-cocoa

I am using Zexmlss for my Excel handling:
http://avemey.com/zexmlss/
https://github.com/Avemey/

Suddenly when compiling I at line:
Code: Pascal  [Select][+][-]
  1. type TZXMLSSave = class; CZXMLSSaveClass = class of TZXMLSSave;
  2.  
  3.      { TZXMLSSave }
  4.  
  5.      TZXMLSSave = class (TInterfacedObject, IZXMLSSave, IZXMLSSaveImpl)
  6.  

get errors:
Quote
zeSave.pas(50,19) Error: No matching implementation for interface method "_AddRef:LongInt; CDecl;" found
zeSave.pas(50,19) Error: No matching implementation for interface method "_Release:LongInt; CDecl;" found
zeSave.pas(50,19) Error: No matching implementation for interface method "_AddRef:LongInt; CDecl;" found
zeSave.pas(50,19) Error: No matching implementation for interface method "_Release:LongInt; CDecl;" found


Some kind of compiler bug or...?
« Last Edit: September 23, 2020, 12:44:24 pm by MISV »

PascalDragon

  • Hero Member
  • *****
  • Posts: 2262
  • Compiler Developer
Re: Strange error after updating Lazarus/FPC
« Reply #1 on: September 23, 2020, 03:33:21 pm »
The problem is around line 127. FPC 3.2.0 and newer is stricter in checking that interface methods do indeed match correctly. The correct declaration of _AddRef and _Release is as they are declared in IInterface:

Code: Pascal  [Select][+][-]
  1.          function _AddRef : longint;{$IFNDEF WINDOWS}cdecl{$ELSE}stdcall{$ENDIF};
  2.          function _Release : longint;{$IFNDEF WINDOWS}cdecl{$ELSE}stdcall{$ENDIF};

 

TinyPortal © 2005-2018