Reputation: 1
I have installed the latest JCL 2016-10-10 and I want to install the latest JVCL, but I'm getting some error messages.
How I can install it?
Windows 10 Home (10.0.0)
JVCL 3.50.0.0
[Generating: Packages]
Generating packages for D24
Loaded template.dpk
Loaded template.dproj
Loaded template.rc
[Compiling: Packages]
[Compiling: JvCore240.bpl]
Embarcadero Delphi for Win32 compiler version 31.0
Copyright (c) 1983,2016 Embarcadero Technologies, Inc.
E:\DelphiComp\XE10.1\JVCL3-2016-10-10\run\JvAppIniStorage.pas(261) Error: E2361 Cannot access private symbol TMemIniFile.FSections
E:\DelphiComp\XE10.1\JVCL3-2016-10-10\run\JvAppIniStorage.pas(261) Warning: W1023 Comparing signed and unsigned types - widened both operands
E:\DelphiComp\XE10.1\JVCL3-2016-10-10\run\JvAppIniStorage.pas(261) Error: E2014 Statement expected, but expression of type 'Boolean' found
E:\DelphiComp\XE10.1\JVCL3-2016-10-10\run\JvAppIniStorage.pas(274) Error: E2361 Cannot access private symbol TMemIniFile.FSections
JvCore.dpk(2356) Fatal: F2063 Could not compile used unit 'JvAppIniStorage.pas'
Upvotes: 0
Views: 695
Reputation: 34919
The Delphi 10.1 Berlin version removed the access of private members through class helpers (see How to access private methods without helpers?). That is the error message you can see, when access to TMemIniFile.FSections
is denied.
Looking at the latest code for JvAppIniStorage.pas, this is fixed:
{ Optimization of TCustomIniFile.ValueExists.
Note that this is a dirty hack, a better way would be to rewrite TMemIniFile;
especially expose FSections. }
{$IFDEF DELPHI2009_UP}
type
TMemIniFileAccess = class(TCustomIniFile)
{$IFDEF RTL310_UP} // 10.1 Berlin removed the access to private fields
{$IFDEF RTL320_UP}
{$MESSAGE WARN 'Check that the new RTL still has FSections as the first member of TMemIniFile'}
{$ENDIF RTL320_UP}
private
FSections: TStringList;
{$ENDIF RTL310_UP}
end;
As said in code comments, this is a dirty hack that works if the FSections
still is declared as the first field in TCustomIniFile
.
And in code:
function TMemIniFileHelper.SectionExists(const Section: string): Boolean;
begin
{$IFDEF RTL310_UP} // 10.1 Berlin removed the access to private fields
Result := TMemIniFileAccess(Self).FSections.IndexOf(Section) >= 0;
{$ELSE}
Result := Self.FSections.IndexOf(Section) >= 0;
{$ENDIF RTL310_UP}
end;
Make sure you have the latest source for jvcl and recompile. Note that the symbol RTL310_UP
is defined in jedi.inc.
Upvotes: 1