Recent

Author Topic: Lazarus 1.6, error installing any package  (Read 4241 times)

MLCasellas

  • Newbie
  • Posts: 5
Lazarus 1.6, error installing any package
« on: September 26, 2016, 11:50:35 am »
Hi!, I'm new here and with Lazarus :-)

I installed version 1.6 and I can´t install packages. Every time I try to install a package shows me these errors:

Code: Pascal  [Select][+][-]
  1. Compile package TMLLazarusPkg 1.1.1.1: Código de salida 1, Errores: 10
  2. uSidexVariant.pas(170,14) Error: function header doesn't match the previous declaration "SetProperty(const tvardata;const AnsiString;const tvardata):Boolean;"
  3. Error: Found declaration: SetProperty(var tvardata;const AnsiString;const tvardata):Boolean;
  4. uSidexVariant.pas(186,14) Error: function header doesn't match the previous declaration "SetProperty(const tvardata;const AnsiString;const tvardata):Boolean;"
  5. Error: Found declaration: SetProperty(var tvardata;const AnsiString;const tvardata):Boolean;
  6. uSidexVariant.pas(202,14) Error: function header doesn't match the previous declaration "SetProperty(const tvardata;const AnsiString;const tvardata):Boolean;"
  7. Error: Found declaration: SetProperty(var tvardata;const AnsiString;const tvardata):Boolean;
  8. uSidexVariant.pas(218,14) Error: function header doesn't match the previous declaration "SetProperty(const tvardata;const AnsiString;const tvardata):Boolean;"
  9. Error: Found declaration: SetProperty(var tvardata;const AnsiString;const tvardata):Boolean;
  10. uSidexVariant.pas(234,14) Error: function header doesn't match the previous declaration "SetProperty(const tvardata;const AnsiString;const tvardata):Boolean;"
  11. Error: Found declaration: SetProperty(var tvardata;const AnsiString;const tvardata):Boolean;

And it leads me to the uSidexVarian unit, line of code:

Code: Pascal  [Select][+][-]
  1. SetProperty function (const V: TVarData; const Name: string;

I installed the previous version of Lazarus, the 1.4.4 and I have not this problem. In this version I can install the components.

Can anyone help me ?, Please, Thank you!

howardpc

  • Hero Member
  • *****
  • Posts: 4144
Re: Lazarus 1.6, error installing any package
« Reply #1 on: September 26, 2016, 11:57:38 am »
Search your disk thoroughly for uSidexVariant.* and delete all such files you find.
You may have some old .ppu or .o files that are interfering.
Then try to reinstall the package.

MLCasellas

  • Newbie
  • Posts: 5
Re: Lazarus 1.6, error installing any package
« Reply #2 on: September 26, 2016, 12:25:54 pm »
Thanks howardpc, I have made the search and these two files are found only in the own package folder:

C:\TML11\pascal\packages\Lazarus\lib\i386-win32\uSidexVariant.o
C:\TML11\pascal\packages\Lazarus\lib\i386-win32\uSidexVariant.ppu

I have deleted, but the problem still occurs exactly the same :-(

rvk

  • Hero Member
  • *****
  • Posts: 6163
Re: Lazarus 1.6, error installing any package
« Reply #3 on: September 26, 2016, 12:54:22 pm »
You have TML installed in C:\TML11. Did you completely remove the C:\TML11 and put in a fresh unzipped version there before compiling/installing in Laz1.6? If you tried installing this in Laz1.4.4 and it worked there are still left-over files in that location (and sub-directory).

Also... the line of code you mention is incorrect. You can't have SetProperty before function like you typed/copied. Did you type this or copy and pasted from the source??

When I look at the file I see this:
Code: Pascal  [Select][+][-]
  1.     function SetProperty(
  2.       {$if defined(FPC) and (FPC_VERSION >= 3)} var {$else} const {$ifend}
  3.       V: TVarData; const Name: string;
  4.       const Value: TVarData): Boolean; override;

You can see the var/const of the first parameter. This changed in FPC 3.0. So please check if you have the latest version of TML for FPC 3.0.
« Last Edit: September 26, 2016, 12:59:11 pm by rvk »

MLCasellas

  • Newbie
  • Posts: 5
Re: Lazarus 1.6, error installing any package
« Reply #4 on: September 26, 2016, 01:01:34 pm »
Well, so far I have managed to install it. But the trouble is that I not even know what I have done, since I'm new. But I found out the following:

There Might Be a change in TInvokeableVariantType Which is the ancestor class of all classes SIDEX variant.
In the prototype is 1.4 Lazarus:

Code: Pascal  [Select][+][-]
  1.  function SetProperty(const V: TVarData; const Name: string;
  2.       const Value: TVarData): Boolean; virtual;

source: https://groups.google.com/forum/m/#!msg/libtml/wAv8jLPMgWU/e3fDYyFuBQAJ

I edited the file uSidexVariant.pas changing "override" to "virtual" here:

Code: Pascal  [Select][+][-]
  1. //------------------------------------------------------------------------------
  2.  
  3. type
  4.  
  5.   { custom variant for sidex binary string }
  6.   TsidexVarBinary = class(TInvokeableVariantType)
  7.   public
  8.     procedure Clear(var V: TVarData); override;
  9.     procedure Copy(var Dest: TVarData; const Source: TVarData;
  10.       const Indirect: Boolean); override;
  11.     function DoFunction(var Dest: TVarData; const V: TVarData;
  12.       const Name: string; const Arguments: TVarDataArray): Boolean; override;
  13.     function DoProcedure(const V: TVarData; const Name: string;
  14.       const Arguments: TVarDataArray): Boolean; override;
  15.     function GetProperty(var Dest: TVarData; const V: TVarData;
  16.       const Name: string): Boolean; override;
  17.     function SetProperty(const V: TVarData; const Name: string;
  18.       const Value: TVarData): Boolean; [b]virtual[/b];
  19.   end;
  20.  
  21.   { custom variant for sidex binary string }
  22.   TsidexVarString = class(TInvokeableVariantType)
  23.   public
  24.     procedure Clear(var V: TVarData); override;
  25.     procedure Copy(var Dest: TVarData; const Source: TVarData;
  26.       const Indirect: Boolean); override;
  27.     function DoFunction(var Dest: TVarData; const V: TVarData;
  28.       const Name: string; const Arguments: TVarDataArray): Boolean; override;
  29.     function DoProcedure(const V: TVarData; const Name: string;
  30.       const Arguments: TVarDataArray): Boolean; override;
  31.     function GetProperty(var Dest: TVarData; const V: TVarData;
  32.       const Name: string): Boolean; override;
  33.     function SetProperty(const V: TVarData; const Name: string;
  34.       const Value: TVarData): Boolean; [b]virtual[/b];
  35.   end;
  36.  
  37.   { custom variant for sidex list }
  38.   TsidexVarList = class(TInvokeableVariantType)
  39.   public
  40.     procedure Clear(var V: TVarData); override;
  41.     procedure Copy(var Dest: TVarData; const Source: TVarData;
  42.       const Indirect: Boolean); override;
  43.     function DoFunction(var Dest: TVarData; const V: TVarData;
  44.       const Name: string; const Arguments: TVarDataArray): Boolean; override;
  45.     function DoProcedure(const V: TVarData; const Name: string;
  46.       const Arguments: TVarDataArray): Boolean; override;
  47.     function GetProperty(var Dest: TVarData; const V: TVarData;
  48.       const Name: string): Boolean; override;
  49.     function SetProperty(const V: TVarData; const Name: string;
  50.       const Value: TVarData): Boolean; [b]virtual[/b];
  51.   end;
  52.  
  53.   { custom variant for sidex dictionary }
  54.   TsidexVarDict = class(TInvokeableVariantType)
  55.   public
  56.     procedure Clear(var V: TVarData); override;
  57.     procedure Copy(var Dest: TVarData; const Source: TVarData;
  58.       const Indirect: Boolean); override;
  59.     function DoFunction(var Dest: TVarData; const V: TVarData;
  60.       const Name: string; const Arguments: TVarDataArray): Boolean; override;
  61.     function DoProcedure(const V: TVarData; const Name: string;
  62.       const Arguments: TVarDataArray): Boolean; override;
  63.     function GetProperty(var Dest: TVarData; const V: TVarData;
  64.       const Name: string): Boolean; override;
  65.     function SetProperty(const V: TVarData; const Name: string;
  66.       const Value: TVarData): Boolean; [b]virtual[/b];
  67.   end;
  68.  
  69.   { custom variant for sidex table }
  70.   TsidexVarTable = class(TInvokeableVariantType)
  71.   public
  72.     procedure Clear(var V: TVarData); override;
  73.     procedure Copy(var Dest: TVarData; const Source: TVarData;
  74.       const Indirect: Boolean); override;
  75.     function DoFunction(var Dest: TVarData; const V: TVarData;
  76.       const Name: string; const Arguments: TVarDataArray): Boolean; override;
  77.     function DoProcedure(const V: TVarData; const Name: string;
  78.       const Arguments: TVarDataArray): Boolean; override;
  79.     function GetProperty(var Dest: TVarData; const V: TVarData;
  80.       const Name: string): Boolean; override;
  81.     function SetProperty(const V: TVarData; const Name: string;
  82.       const Value: TVarData): Boolean; [b]virtual[/b];
  83.   end;
  84.  
  85. //------------------------------------------------------------------------------


Now it works, so I keep learning (especially to know that I have done  8) )

rvk

  • Hero Member
  • *****
  • Posts: 6163
Re: Lazarus 1.6, error installing any package
« Reply #5 on: September 26, 2016, 01:05:31 pm »
Well, so far I have managed to install it. But the trouble is that I not even know what I have done, since I'm new. But I found out the following:
Why not just download the new fixed source from https://github.com/tml21/libtml-pascal ??

It has the code fixed for FPC 3.0.
(Before FPC 3.0 SetProperty had the first parameter as const and from FPC  3.0+ it is a var)

I wouldn't change the override to virtual like you did !!! It can have unforeseen side-effects.
Just download the new source and it is good to go.

MLCasellas

  • Newbie
  • Posts: 5
Re: Lazarus 1.6, error installing any package
« Reply #6 on: September 26, 2016, 01:08:43 pm »
rvk, thanks!!! I have not seen the fixed, sorry :-)

MLCasellas

  • Newbie
  • Posts: 5
Re: Lazarus 1.6, error installing any package
« Reply #7 on: September 26, 2016, 01:34:18 pm »
I uninstalled everything, completely, leaving no trace of anything (Lazarus and TML). I reinstalled Lazarus 1.6 , after reinstalled TML (replacing the fixed uSidexVariant.pas file, downloaded from GibHub). And ... now works all perfect!

Thank you guys!!!  :)

 

TinyPortal © 2005-2018