Recent

Author Topic: Errors compiling TSynEdit ad TSynHighligher routines in Lazarus 1.6.2?  (Read 9025 times)

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9794
  • Debugger - SynEdit - and more
    • wiki
Re: Errors compiling TSynEdit ad TSynHighligher routines in Lazarus 1.6.2?
« Reply #15 on: March 01, 2017, 03:51:20 pm »
I did just build the 6.1 on win 64bit (1.6.4 / 3.0.2) (I did not apply the patch, but that should not have an effect on SynEdit)

There is a warning about the search path. Apparently the project add the path of SynEdit. It should use the package instead.
But that does not seem to be the issue.
(Well actually it could be, it can lead to stale ppu files, make sure you check in your apps output folder for any synedit related ppu, and delete them)

I had to comment the 2 lines in HL-Lua. (it seems the ptruint trick will work here)

I did not get any error in syneditmarks.

-------------
try in an empty project (without the lua code) to use the syneditmarks, and writeln the sizeof TSynEditMarkChangeReasons
It should be 4.
label1.Caption := IntToStr(sizeof(TSynEditMarkChangeReasons));

vfclists

  • Hero Member
  • *****
  • Posts: 1013
    • HowTos Considered Harmful?
Re: Errors compiling TSynEdit ad TSynHighligher routines in Lazarus 1.6.2?
« Reply #16 on: March 04, 2017, 11:58:12 pm »
I did just build the 6.1 on win 64bit (1.6.4 / 3.0.2) (I did not apply the patch, but that should not have an effect on SynEdit)

There is a warning about the search path. Apparently the project add the path of SynEdit. It should use the package instead.
But that does not seem to be the issue.
(Well actually it could be, it can lead to stale ppu files, make sure you check in your apps output folder for any synedit related ppu, and delete them)

I had to comment the 2 lines in HL-Lua. (it seems the ptruint trick will work here)

I did not get any error in syneditmarks.

-------------
try in an empty project (without the lua code) to use the syneditmarks, and writeln the sizeof TSynEditMarkChangeReasons
It should be 4.
label1.Caption := IntToStr(sizeof(TSynEditMarkChangeReasons));

I have managed to get them both working.

The problem in the 0.5.0 version was fixed by removing SynEdit and RTTI controls from the project path and adding their packages.

Quote
b]error message[/b]
Code: Pascal  [Select][+][-]
  1. syneditmarks.pp(1048,35) Error: Illegal type conversion: "TSynEditMarkChangeReasons" to "LongInt"
  2.  

offending code
Code: Pascal  [Select][+][-]
  1. procedure TSynEditMarkChangedHandlerList.Add(AHandler: TSynEditMarkChangeEvent;
  2.   Changes: TSynEditMarkChangeReasons);
  3. begin
  4.   AddBitFilter(TMethod(AHandler), LongInt(Changes));
  5. end;


I don't understand why removing the package directories from the path and adding the packages themselves to the project should fix those issues.
The .lpr file as this code ad the top. Could the {mode Deplhi} be a factor.
Code: Pascal  [Select][+][-]
  1. library vcl;
  2.  
  3. {$mode Delphi}{$H+}
  4. {$i vcldef.inc}
  5.  
  6. {$R *.res}
  7.  

How could one analyze the code for the reason? What are the circumstances in which compiling the code rather than linking to the precompiled units should cause an error?



The problem in the 0.6.1 version was fixed by using PtrUint.

Code: Pascal  [Select][+][-]
  1. procedure TSynLuaSyn.SetRange(Value: Pointer);
  2. begin
  3.   fRange := TRangeState(PtrUint((Value)));
  4. end;
  5.  
  6. function TSynLuaSyn.GetRange: Pointer;
  7. begin
  8.   Result := Pointer(PtrUint(fRange));
  9. end;
  10.  


Lazarus 3.0/FPC 3.2.2

 

TinyPortal © 2005-2018