Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to use latest LGenerics with latest FPC trunk #16

Open
ikelaiah opened this issue May 4, 2024 · 14 comments
Open

Unable to use latest LGenerics with latest FPC trunk #16

ikelaiah opened this issue May 4, 2024 · 14 comments

Comments

@ikelaiah
Copy link

ikelaiah commented May 4, 2024

Hi @avk959,

Thanks for the fine library for FPC. I am runnning into issues when compiling with FPC trunk and using lghashmap.
I get the following error.

Compile Project, Mode: Release, Target: C:\Users\iwank\<secret>\1brc-ObjectPascal\bin\ikelaiah.exe: Exit code 1, Errors: 40, Hints: 2
Hint: Start of reading config file C:\fpcupdeluxe\fpc\bin\x86_64-win64\fpc.cfg
Hint: End of reading config file C:\fpcupdeluxe\fpc\bin\x86_64-win64\fpc.cfg
Verbose: Free Pascal Compiler version 3.3.1-15663-ga888a141a2 [2024/05/04] for x86_64
Verbose: Copyright (c) 1993-2024 by Florian Klaempfl and others
Verbose: Target OS: Win64 for x64
Verbose: Compiling OneBRC.lpr
Verbose: Compiling weatherstation.pas
lgabstractcontainer.pas(140,6) Error: No matching implementation for interface method "FindFirst(out OpenString):System.Boolean;" found
lgabstractcontainer.pas(140,6) Error: No matching implementation for interface method "FindLast(out OpenString):System.Boolean;" found
lgabstractcontainer.pas(140,6) Error: No matching implementation for interface method "FindMin(out OpenString;TGLessCompare$1$crc640B6513_crc69E394E1):System.Boolean;" found
lgabstractcontainer.pas(140,6) Error: No matching implementation for interface method "FindMin(out OpenString;TGOnLessCompare$1$crc640B6513_crc69E394E1):System.Boolean;" found
lgabstractcontainer.pas(140,6) Error: No matching implementation for interface method "FindMin(out OpenString;TGNestLessCompare$1$crc640B6513_crc69E394E1):System.Boolean;" found
lgabstractcontainer.pas(140,6) Error: No matching implementation for interface method "FindMax(out OpenString;TGLessCompare$1$crc640B6513_crc69E394E1):System.Boolean;" found
lgabstractcontainer.pas(140,6) Error: No matching implementation for interface method "FindMax(out OpenString;TGOnLessCompare$1$crc640B6513_crc69E394E1):System.Boolean;" found
lgabstractcontainer.pas(140,6) Error: No matching implementation for interface method "FindMax(out OpenString;TGNestLessCompare$1$crc640B6513_crc69E394E1):System.Boolean;" found
enumsh.inc(25,19) Error: No matching implementation for interface method "FindFirst(out OpenString):System.Boolean;" found
enumsh.inc(25,19) Error: No matching implementation for interface method "FindLast(out OpenString):System.Boolean;" found
enumsh.inc(25,19) Error: No matching implementation for interface method "FindMin(out OpenString;TGLessCompare$1$crc640B6513_crc69E394E1):System.Boolean;" found
enumsh.inc(25,19) Error: No matching implementation for interface method "FindMin(out OpenString;TGOnLessCompare$1$crc640B6513_crc69E394E1):System.Boolean;" found
enumsh.inc(25,19) Error: No matching implementation for interface method "FindMin(out OpenString;TGNestLessCompare$1$crc640B6513_crc69E394E1):System.Boolean;" found
enumsh.inc(25,19) Error: No matching implementation for interface method "FindMax(out OpenString;TGLessCompare$1$crc640B6513_crc69E394E1):System.Boolean;" found
enumsh.inc(25,19) Error: No matching implementation for interface method "FindMax(out OpenString;TGOnLessCompare$1$crc640B6513_crc69E394E1):System.Boolean;" found
enumsh.inc(25,19) Error: No matching implementation for interface method "FindMax(out OpenString;TGNestLessCompare$1$crc640B6513_crc69E394E1):System.Boolean;" found
lgabstractcontainer.pas(201,6) Error: No matching implementation for interface method "FindFirst(out OpenString):System.Boolean;" found
lgabstractcontainer.pas(201,6) Error: No matching implementation for interface method "FindLast(out OpenString):System.Boolean;" found
lgabstractcontainer.pas(201,6) Error: No matching implementation for interface method "FindMin(out OpenString;TGLessCompare$1$crc640B6513_crc69E394E1):System.Boolean;" found
lgabstractcontainer.pas(201,6) Error: No matching implementation for interface method "FindMin(out OpenString;TGOnLessCompare$1$crc640B6513_crc69E394E1):System.Boolean;" found
lgabstractcontainer.pas(201,6) Error: No matching implementation for interface method "FindMin(out OpenString;TGNestLessCompare$1$crc640B6513_crc69E394E1):System.Boolean;" found
lgabstractcontainer.pas(201,6) Error: No matching implementation for interface method "FindMax(out OpenString;TGLessCompare$1$crc640B6513_crc69E394E1):System.Boolean;" found
lgabstractcontainer.pas(201,6) Error: No matching implementation for interface method "FindMax(out OpenString;TGOnLessCompare$1$crc640B6513_crc69E394E1):System.Boolean;" found
lgabstractcontainer.pas(201,6) Error: No matching implementation for interface method "FindMax(out OpenString;TGNestLessCompare$1$crc640B6513_crc69E394E1):System.Boolean;" found
lgutils.pas(259,6) Error: No matching implementation for interface method "FindFirst(out OpenString):System.Boolean;" found
lgutils.pas(259,6) Error: No matching implementation for interface method "FindLast(out OpenString):System.Boolean;" found
lgutils.pas(259,6) Error: No matching implementation for interface method "FindMin(out OpenString;TGLessCompare$1$crc640B6513_crc69E394E1):System.Boolean;" found
lgutils.pas(259,6) Error: No matching implementation for interface method "FindMin(out OpenString;TGOnLessCompare$1$crc640B6513_crc69E394E1):System.Boolean;" found
lgutils.pas(259,6) Error: No matching implementation for interface method "FindMin(out OpenString;TGNestLessCompare$1$crc640B6513_crc69E394E1):System.Boolean;" found
lgutils.pas(259,6) Error: No matching implementation for interface method "FindMax(out OpenString;TGLessCompare$1$crc640B6513_crc69E394E1):System.Boolean;" found
lgutils.pas(259,6) Error: No matching implementation for interface method "FindMax(out OpenString;TGOnLessCompare$1$crc640B6513_crc69E394E1):System.Boolean;" found
lgutils.pas(259,6) Error: No matching implementation for interface method "FindMax(out OpenString;TGNestLessCompare$1$crc640B6513_crc69E394E1):System.Boolean;" found
lgutils.pas(259,6) Error: No matching implementation for interface method "FindFirst(out OpenString):System.Boolean;" found
lgutils.pas(259,6) Error: No matching implementation for interface method "FindLast(out OpenString):System.Boolean;" found
lgutils.pas(259,6) Error: No matching implementation for interface method "FindMin(out OpenString;TGLessCompare$1$crc640B6513_crc69E394E1):System.Boolean;" found
lgutils.pas(259,6) Error: No matching implementation for interface method "FindMin(out OpenString;TGOnLessCompare$1$crc640B6513_crc69E394E1):System.Boolean;" found
lgutils.pas(259,6) Error: No matching implementation for interface method "FindMin(out OpenString;TGNestLessCompare$1$crc640B6513_crc69E394E1):System.Boolean;" found
lgutils.pas(259,6) Error: No matching implementation for interface method "FindMax(out OpenString;TGLessCompare$1$crc640B6513_crc69E394E1):System.Boolean;" found
lgutils.pas(259,6) Error: No matching implementation for interface method "FindMax(out OpenString;TGOnLessCompare$1$crc640B6513_crc69E394E1):System.Boolean;" found
lgutils.pas(259,6) Error: No matching implementation for interface method "FindMax(out OpenString;TGNestLessCompare$1$crc640B6513_crc69E394E1):System.Boolean;" found
weatherstation.pas(66,1) Verbose: There were 40 errors compiling module, stopping
Verbose: Compilation aborted
Verbose: C:\fpcupdeluxe\fpc\bin\x86_64-win64\ppcx64.exe returned an error exitcode

Can you help?
Many thanks.

-Iwan

@ikelaiah ikelaiah changed the title Unable to use with FPC trunk Unable to use latest LGenerics with latest FPC trunk May 4, 2024
@avk959
Copy link
Owner

avk959 commented May 5, 2024

Yeah, I'm aware of that. FPC changed their approach to member visibility in generics not too long ago. I'll have to look into it as soon as I have enough time.

@ikelaiah
Copy link
Author

ikelaiah commented May 5, 2024

Thanks @avk959 .

@avk959
Copy link
Owner

avk959 commented May 7, 2024

Seems to be fixed?
At least yesterday's FPC-3.3.1-15663-ga888a141a2-dirty(x86_64-linux) can now compile the current version of LGenerics.

@ikelaiah
Copy link
Author

ikelaiah commented May 9, 2024

Thanks @avk959 , I'll test.

@ikelaiah
Copy link
Author

Hi @avk959 ,

Since you compiled it with FPC-3.3.1-15663-ga888a141a2-dirty(x86_64-linux), most likely my setup is not right.
Thanks for checking, and I'm closing this issue now.

Compile Project, Mode: Release, Target: C:\Users\iwank\Documents\github\1brc-ObjectPascal\bin\ikelaiah.exe: Exit code 1, Errors: 40, Hints: 2
Hint: Start of reading config file C:\fpcupdeluxe\fpc\bin\x86_64-win64\fpc.cfg
Hint: End of reading config file C:\fpcupdeluxe\fpc\bin\x86_64-win64\fpc.cfg
Verbose: Free Pascal Compiler version 3.3.1-15679-g5284948087 [2024/05/09] for x86_64
Verbose: Copyright (c) 1993-2024 by Florian Klaempfl and others
Verbose: Target OS: Win64 for x64
Verbose: Compiling OneBRC.lpr
Verbose: Compiling weatherstation.pas
lgabstractcontainer.pas(140,6) Error: No matching implementation for interface method "FindFirst(out OpenString):System.Boolean;" found
lgabstractcontainer.pas(140,6) Error: No matching implementation for interface method "FindLast(out OpenString):System.Boolean;" found
lgabstractcontainer.pas(140,6) Error: No matching implementation for interface method "FindMin(out OpenString;TGLessCompare$1$crc640B6513_crc69E394E1):System.Boolean;" found
lgabstractcontainer.pas(140,6) Error: No matching implementation for interface method "FindMin(out OpenString;TGOnLessCompare$1$crc640B6513_crc69E394E1):System.Boolean;" found
lgabstractcontainer.pas(140,6) Error: No matching implementation for interface method "FindMin(out OpenString;TGNestLessCompare$1$crc640B6513_crc69E394E1):System.Boolean;" found
lgabstractcontainer.pas(140,6) Error: No matching implementation for interface method "FindMax(out OpenString;TGLessCompare$1$crc640B6513_crc69E394E1):System.Boolean;" found
lgabstractcontainer.pas(140,6) Error: No matching implementation for interface method "FindMax(out OpenString;TGOnLessCompare$1$crc640B6513_crc69E394E1):System.Boolean;" found
lgabstractcontainer.pas(140,6) Error: No matching implementation for interface method "FindMax(out OpenString;TGNestLessCompare$1$crc640B6513_crc69E394E1):System.Boolean;" found
enumsh.inc(25,19) Error: No matching implementation for interface method "FindFirst(out OpenString):System.Boolean;" found
enumsh.inc(25,19) Error: No matching implementation for interface method "FindLast(out OpenString):System.Boolean;" found
enumsh.inc(25,19) Error: No matching implementation for interface method "FindMin(out OpenString;TGLessCompare$1$crc640B6513_crc69E394E1):System.Boolean;" found
enumsh.inc(25,19) Error: No matching implementation for interface method "FindMin(out OpenString;TGOnLessCompare$1$crc640B6513_crc69E394E1):System.Boolean;" found
enumsh.inc(25,19) Error: No matching implementation for interface method "FindMin(out OpenString;TGNestLessCompare$1$crc640B6513_crc69E394E1):System.Boolean;" found
enumsh.inc(25,19) Error: No matching implementation for interface method "FindMax(out OpenString;TGLessCompare$1$crc640B6513_crc69E394E1):System.Boolean;" found
enumsh.inc(25,19) Error: No matching implementation for interface method "FindMax(out OpenString;TGOnLessCompare$1$crc640B6513_crc69E394E1):System.Boolean;" found
enumsh.inc(25,19) Error: No matching implementation for interface method "FindMax(out OpenString;TGNestLessCompare$1$crc640B6513_crc69E394E1):System.Boolean;" found
lgabstractcontainer.pas(201,6) Error: No matching implementation for interface method "FindFirst(out OpenString):System.Boolean;" found
lgabstractcontainer.pas(201,6) Error: No matching implementation for interface method "FindLast(out OpenString):System.Boolean;" found
lgabstractcontainer.pas(201,6) Error: No matching implementation for interface method "FindMin(out OpenString;TGLessCompare$1$crc640B6513_crc69E394E1):System.Boolean;" found
lgabstractcontainer.pas(201,6) Error: No matching implementation for interface method "FindMin(out OpenString;TGOnLessCompare$1$crc640B6513_crc69E394E1):System.Boolean;" found
lgabstractcontainer.pas(201,6) Error: No matching implementation for interface method "FindMin(out OpenString;TGNestLessCompare$1$crc640B6513_crc69E394E1):System.Boolean;" found
lgabstractcontainer.pas(201,6) Error: No matching implementation for interface method "FindMax(out OpenString;TGLessCompare$1$crc640B6513_crc69E394E1):System.Boolean;" found
lgabstractcontainer.pas(201,6) Error: No matching implementation for interface method "FindMax(out OpenString;TGOnLessCompare$1$crc640B6513_crc69E394E1):System.Boolean;" found
lgabstractcontainer.pas(201,6) Error: No matching implementation for interface method "FindMax(out OpenString;TGNestLessCompare$1$crc640B6513_crc69E394E1):System.Boolean;" found
lgutils.pas(259,6) Error: No matching implementation for interface method "FindFirst(out OpenString):System.Boolean;" found
lgutils.pas(259,6) Error: No matching implementation for interface method "FindLast(out OpenString):System.Boolean;" found
lgutils.pas(259,6) Error: No matching implementation for interface method "FindMin(out OpenString;TGLessCompare$1$crc640B6513_crc69E394E1):System.Boolean;" found
lgutils.pas(259,6) Error: No matching implementation for interface method "FindMin(out OpenString;TGOnLessCompare$1$crc640B6513_crc69E394E1):System.Boolean;" found
lgutils.pas(259,6) Error: No matching implementation for interface method "FindMin(out OpenString;TGNestLessCompare$1$crc640B6513_crc69E394E1):System.Boolean;" found
lgutils.pas(259,6) Error: No matching implementation for interface method "FindMax(out OpenString;TGLessCompare$1$crc640B6513_crc69E394E1):System.Boolean;" found
lgutils.pas(259,6) Error: No matching implementation for interface method "FindMax(out OpenString;TGOnLessCompare$1$crc640B6513_crc69E394E1):System.Boolean;" found
lgutils.pas(259,6) Error: No matching implementation for interface method "FindMax(out OpenString;TGNestLessCompare$1$crc640B6513_crc69E394E1):System.Boolean;" found
lgutils.pas(259,6) Error: No matching implementation for interface method "FindFirst(out OpenString):System.Boolean;" found
lgutils.pas(259,6) Error: No matching implementation for interface method "FindLast(out OpenString):System.Boolean;" found
lgutils.pas(259,6) Error: No matching implementation for interface method "FindMin(out OpenString;TGLessCompare$1$crc640B6513_crc69E394E1):System.Boolean;" found
lgutils.pas(259,6) Error: No matching implementation for interface method "FindMin(out OpenString;TGOnLessCompare$1$crc640B6513_crc69E394E1):System.Boolean;" found
lgutils.pas(259,6) Error: No matching implementation for interface method "FindMin(out OpenString;TGNestLessCompare$1$crc640B6513_crc69E394E1):System.Boolean;" found
lgutils.pas(259,6) Error: No matching implementation for interface method "FindMax(out OpenString;TGLessCompare$1$crc640B6513_crc69E394E1):System.Boolean;" found
lgutils.pas(259,6) Error: No matching implementation for interface method "FindMax(out OpenString;TGOnLessCompare$1$crc640B6513_crc69E394E1):System.Boolean;" found
lgutils.pas(259,6) Error: No matching implementation for interface method "FindMax(out OpenString;TGNestLessCompare$1$crc640B6513_crc69E394E1):System.Boolean;" found
weatherstation.pas(70,1) Verbose: There were 40 errors compiling module, stopping
Verbose: Compilation aborted
Verbose: C:\fpcupdeluxe\fpc\bin\x86_64-win64\ppcx64.exe returned an error exitcode

@avk959
Copy link
Owner

avk959 commented May 10, 2024

Since you compiled it with FPC-3.3.1-15663-ga888a141a2-dirty(x86_64-linux), most likely my setup is not right.

It's impossible to give any advice without seeing the source code.

@ikelaiah
Copy link
Author

Hi @avk959

I'm reopening this again, providing my code (which I should have provided earlier).
I'm still stuck, hoping you can help.

program GHashmapLPDemo;

{$mode objfpc}{$H+}

uses
  {$IFDEF UNIX}
  cmem, cthreads,
  {$ENDIF}
  Classes,
  lgHashMap,
  SysUtils;

type
  TDictionary = specialize TGHashMapLP<shortstring, int64>;

var
  dict: TDictionary;
  s:shortstring;

begin

  dict := TDictionary.Create;
  try
    dict.Add('One', 1);
    dict.Add('Two', 2);
    dict.Add('Three', 3);
    dict.Add('Four', 4);

    WriteLn('Printing key-value...');

    for s in dict.Keys do
    begin
      WriteLn('Key: ', s, ' Value: ', dict[s]);
    end;

  finally
    dict.Free;
  end;

  WriteLn('Press enter to exit');
  ReadLn;

end.

And I get this error message when I compile using F9 in Lazarus IDE.

Compile Project, Target: C:\Users\iwank\Documents\fp-projects\free-pascal-snippets\LGenerics\GHashmapLP\GHashmapLPDemo.exe: Exit code 1, Errors: 40, Hints: 2
Hint: Start of reading config file C:\fpcupdeluxe\fpc\bin\x86_64-win64\fpc.cfg
Hint: End of reading config file C:\fpcupdeluxe\fpc\bin\x86_64-win64\fpc.cfg
Verbose: Free Pascal Compiler version 3.3.1-15679-g5284948087 [2024/05/09] for x86_64
Verbose: Copyright (c) 1993-2024 by Florian Klaempfl and others
Verbose: Target OS: Win64 for x64
Verbose: Compiling GHashmapLPDemo.lpr
lgabstractcontainer.pas(140,6) Error: No matching implementation for interface method "FindFirst(out OpenString):System.Boolean;" found
lgabstractcontainer.pas(140,6) Error: No matching implementation for interface method "FindLast(out OpenString):System.Boolean;" found
lgabstractcontainer.pas(140,6) Error: No matching implementation for interface method "FindMin(out OpenString;TGLessCompare$1$crc640B6513_crc69E394E1):System.Boolean;" found
lgabstractcontainer.pas(140,6) Error: No matching implementation for interface method "FindMin(out OpenString;TGOnLessCompare$1$crc640B6513_crc69E394E1):System.Boolean;" found
lgabstractcontainer.pas(140,6) Error: No matching implementation for interface method "FindMin(out OpenString;TGNestLessCompare$1$crc640B6513_crc69E394E1):System.Boolean;" found
lgabstractcontainer.pas(140,6) Error: No matching implementation for interface method "FindMax(out OpenString;TGLessCompare$1$crc640B6513_crc69E394E1):System.Boolean;" found
lgabstractcontainer.pas(140,6) Error: No matching implementation for interface method "FindMax(out OpenString;TGOnLessCompare$1$crc640B6513_crc69E394E1):System.Boolean;" found
lgabstractcontainer.pas(140,6) Error: No matching implementation for interface method "FindMax(out OpenString;TGNestLessCompare$1$crc640B6513_crc69E394E1):System.Boolean;" found
enumsh.inc(25,19) Error: No matching implementation for interface method "FindFirst(out OpenString):System.Boolean;" found
enumsh.inc(25,19) Error: No matching implementation for interface method "FindLast(out OpenString):System.Boolean;" found
enumsh.inc(25,19) Error: No matching implementation for interface method "FindMin(out OpenString;TGLessCompare$1$crc640B6513_crc69E394E1):System.Boolean;" found
enumsh.inc(25,19) Error: No matching implementation for interface method "FindMin(out OpenString;TGOnLessCompare$1$crc640B6513_crc69E394E1):System.Boolean;" found
enumsh.inc(25,19) Error: No matching implementation for interface method "FindMin(out OpenString;TGNestLessCompare$1$crc640B6513_crc69E394E1):System.Boolean;" found
enumsh.inc(25,19) Error: No matching implementation for interface method "FindMax(out OpenString;TGLessCompare$1$crc640B6513_crc69E394E1):System.Boolean;" found
enumsh.inc(25,19) Error: No matching implementation for interface method "FindMax(out OpenString;TGOnLessCompare$1$crc640B6513_crc69E394E1):System.Boolean;" found
enumsh.inc(25,19) Error: No matching implementation for interface method "FindMax(out OpenString;TGNestLessCompare$1$crc640B6513_crc69E394E1):System.Boolean;" found
lgabstractcontainer.pas(201,6) Error: No matching implementation for interface method "FindFirst(out OpenString):System.Boolean;" found
lgabstractcontainer.pas(201,6) Error: No matching implementation for interface method "FindLast(out OpenString):System.Boolean;" found
lgabstractcontainer.pas(201,6) Error: No matching implementation for interface method "FindMin(out OpenString;TGLessCompare$1$crc640B6513_crc69E394E1):System.Boolean;" found
lgabstractcontainer.pas(201,6) Error: No matching implementation for interface method "FindMin(out OpenString;TGOnLessCompare$1$crc640B6513_crc69E394E1):System.Boolean;" found
lgabstractcontainer.pas(201,6) Error: No matching implementation for interface method "FindMin(out OpenString;TGNestLessCompare$1$crc640B6513_crc69E394E1):System.Boolean;" found
lgabstractcontainer.pas(201,6) Error: No matching implementation for interface method "FindMax(out OpenString;TGLessCompare$1$crc640B6513_crc69E394E1):System.Boolean;" found
lgabstractcontainer.pas(201,6) Error: No matching implementation for interface method "FindMax(out OpenString;TGOnLessCompare$1$crc640B6513_crc69E394E1):System.Boolean;" found
lgabstractcontainer.pas(201,6) Error: No matching implementation for interface method "FindMax(out OpenString;TGNestLessCompare$1$crc640B6513_crc69E394E1):System.Boolean;" found
lgutils.pas(259,6) Error: No matching implementation for interface method "FindFirst(out OpenString):System.Boolean;" found
lgutils.pas(259,6) Error: No matching implementation for interface method "FindLast(out OpenString):System.Boolean;" found
lgutils.pas(259,6) Error: No matching implementation for interface method "FindMin(out OpenString;TGLessCompare$1$crc640B6513_crc69E394E1):System.Boolean;" found
lgutils.pas(259,6) Error: No matching implementation for interface method "FindMin(out OpenString;TGOnLessCompare$1$crc640B6513_crc69E394E1):System.Boolean;" found
lgutils.pas(259,6) Error: No matching implementation for interface method "FindMin(out OpenString;TGNestLessCompare$1$crc640B6513_crc69E394E1):System.Boolean;" found
lgutils.pas(259,6) Error: No matching implementation for interface method "FindMax(out OpenString;TGLessCompare$1$crc640B6513_crc69E394E1):System.Boolean;" found
lgutils.pas(259,6) Error: No matching implementation for interface method "FindMax(out OpenString;TGOnLessCompare$1$crc640B6513_crc69E394E1):System.Boolean;" found
lgutils.pas(259,6) Error: No matching implementation for interface method "FindMax(out OpenString;TGNestLessCompare$1$crc640B6513_crc69E394E1):System.Boolean;" found
lgutils.pas(259,6) Error: No matching implementation for interface method "FindFirst(out OpenString):System.Boolean;" found
lgutils.pas(259,6) Error: No matching implementation for interface method "FindLast(out OpenString):System.Boolean;" found
lgutils.pas(259,6) Error: No matching implementation for interface method "FindMin(out OpenString;TGLessCompare$1$crc640B6513_crc69E394E1):System.Boolean;" found
lgutils.pas(259,6) Error: No matching implementation for interface method "FindMin(out OpenString;TGOnLessCompare$1$crc640B6513_crc69E394E1):System.Boolean;" found
lgutils.pas(259,6) Error: No matching implementation for interface method "FindMin(out OpenString;TGNestLessCompare$1$crc640B6513_crc69E394E1):System.Boolean;" found
lgutils.pas(259,6) Error: No matching implementation for interface method "FindMax(out OpenString;TGLessCompare$1$crc640B6513_crc69E394E1):System.Boolean;" found
lgutils.pas(259,6) Error: No matching implementation for interface method "FindMax(out OpenString;TGOnLessCompare$1$crc640B6513_crc69E394E1):System.Boolean;" found
lgutils.pas(259,6) Error: No matching implementation for interface method "FindMax(out OpenString;TGNestLessCompare$1$crc640B6513_crc69E394E1):System.Boolean;" found
GHashmapLPDemo.lpr(46,0) Verbose: There were 40 errors compiling module, stopping
Verbose: Compilation aborted
Verbose: C:\fpcupdeluxe\fpc\bin\x86_64-win64\ppcx64.exe returned an error exitcode

Many thanks,
Iwan

@ikelaiah ikelaiah reopened this May 15, 2024
@gcarreno
Copy link

Hey Iwan(@ikelaiah),

Could you provide the compiler and Lazarus version please?
Many thanks in advance!!
If you did already, I'm really sorry for repeating the question!! 🫂 ❤️

Cheers,
Gus

@ikelaiah
Copy link
Author

@gcarreno , sure!

Lazarus 3.99 (rev main_3_99-1970-g06f123d8dd) FPC 3.3.1 x86_64-win64-win32/win64
Free Pascal Compiler version 3.3.1-15679-g5284948087

Thanks.

@avk959
Copy link
Owner

avk959 commented May 15, 2024

Looks like the OpenStrings compiler switch is now enabled by default in DELPHI mode.
Just try replace line 22 in the lgUtils unit with {$MODE DELPHI}{$P-}.

@ikelaiah
Copy link
Author

Thanks for the suggestion.
Here's what I did.

  1. Replaced line 22 in the lgUtils unit with {$MODE DELPHI}{$P-}
  2. Reloaded and recompiled the lgenerics.lpk
  3. Cleaned up project and recompiled

It works in Debug mode, with correct output.

$ ./GHashmapLPDemo.exe
Printing key-value...
Key: Two Value: 2
Key: Four Value: 4
Key: Three Value: 3
Key: One Value: 1
Press enter to exit

Heap dump by heaptrc unit of "C:\Users\iwank\Documents\fp-projects\free-pascal-snippets\LGenerics\GHashmapLP\GHashmapLPDemo.exe"
131 memory blocks allocated : 8598/8944
131 memory blocks freed     : 8598/8944
0 unfreed memory blocks : 0
True heap size : 393216 (352 used in System startup)
True free heap : 392864

When I run in Release mode, it give me the following.

$ ./GHashmapLPDemo.exe
An unhandled exception occurred at $0000000100030B39:
EAccessViolation: Access violation
  $0000000100030B39
  $0000000100030E67
  $0000000100030CC3
  $0000000100033A42
  $0000000100034736
  $0000000100042A80
  $00000001000017F0
  $00007FFAE1AC257D
  $00007FFAE300AA48

Progress! We are getting somewhere.

-Iwan

@ikelaiah
Copy link
Author

Additional info.

When I compile the project under Release mode, I get the2 warnings. But no warning in the Debug mode.

Warning: Object file "GHashmapLPDemo.o" contains 32 bit absolute relocation to symbol ".data.n_TC_$GHASHMAPLPDEMO_$$__static_tgopenaddressing$4$crc0769d515_crc7da784b1_MAX_CAPACITY".
Warning: Object file "GHashmapLPDemo.o" contains 32 bit absolute relocation to symbol ".data.n_TC_$GHASHMAPLPDEMO_$$__static_tgopenaddressing$4$crc0769d515_crc7da784b1_MAX_CAPACITY".

Full message from Lazarus when compiling in Release mode.

Compile Project, Mode: Release, Target: C:\Users\iwank\Documents\fp-projects\free-pascal-snippets\LGenerics\GHashmapLP\GHashmapLPDemo.exe: Success, Warnings: 2, Hints: 2
Hint: Start of reading config file C:\fpcupdeluxe\fpc\bin\x86_64-win64\fpc.cfg
Hint: End of reading config file C:\fpcupdeluxe\fpc\bin\x86_64-win64\fpc.cfg
Verbose: Free Pascal Compiler version 3.3.1-15679-g5284948087 [2024/05/09] for x86_64
Verbose: Copyright (c) 1993-2024 by Florian Klaempfl and others
Verbose: Target OS: Win64 for x64
Verbose: Compiling GHashmapLPDemo.lpr
Verbose: Linking C:\Users\iwank\Documents\fp-projects\free-pascal-snippets\LGenerics\GHashmapLP\GHashmapLPDemo.exe
Warning: Object file "GHashmapLPDemo.o" contains 32 bit absolute relocation to symbol ".data.n_TC_$GHASHMAPLPDEMO_$$__static_tgopenaddressing$4$crc0769d515_crc7da784b1_MAX_CAPACITY".
Warning: Object file "GHashmapLPDemo.o" contains 32 bit absolute relocation to symbol ".data.n_TC_$GHASHMAPLPDEMO_$$__static_tgopenaddressing$4$crc0769d515_crc7da784b1_MAX_CAPACITY".
Verbose: 45 lines compiled, 1.3 sec, 481664 bytes code, 14308 bytes data
Verbose: 2 warning(s) issued
Verbose: 2 hint(s) issued

@avk959
Copy link
Owner

avk959 commented May 16, 2024

My results for your example are:

  • FPC 3.3.1-15705-gac8fefbc2b-dirty-x86_64-linux,
    optimization level -O3: OK;
  • FPC 3.3.1-15682-g59e307ec2e-x86_64-win64,
    optimization level -O3: Access violation;
    optimization level -O1: OK;

To me all this along with the linker message looks like a compiler problem, what about you?

@ikelaiah
Copy link
Author

I see. It does look like a compiler's problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants