#1 2019-07-25 21:19:28

EMartin
Member
From: Buenos Aires - Argentina
Registered: 2013-01-09
Posts: 332

Error compiling in Lazarus/FPC

Hi @ab, I'm starting try to use Lazarus/FPC. I have installed mORMot with FPCUpDeluxe, and I when added the unit SynCommons to default Lazarus project (after Lazarus is started) and when I compile I have the following error:

Compile Project, Target: D:\fpcupdeluxe\projects\project1.exe: Exit code 1, Errors: 1, Warnings: 5, Hints: 9
SynLZ.pas(652,18) Hint: Local variable "offset" does not seem to be initialized
SynLZ.pas(660,21) Warning: Local variable "cache" does not seem to be initialized
SynLZ.pas(723,7) Hint: Conversion between ordinals and pointers is not portable
SynLZ.pas(723,19) Hint: Conversion between ordinals and pointers is not portable
SynLZ.pas(724,10) Hint: Conversion between ordinals and pointers is not portable
SynLZ.pas(726,13) Hint: Conversion between ordinals and pointers is not portable
SynLZ.pas(728,9) Hint: Conversion between ordinals and pointers is not portable
SynLZ.pas(1196,51) Hint: Local variable "offset" does not seem to be initialized
SynLZ.pas(1286,69) Hint: Local variable "offset" does not seem to be initialized
SynLZ.pas(1325,18) Hint: Local variable "offset" does not seem to be initialized
SynLZ.pas(1333,21) Warning: Local variable "cache" does not seem to be initialized
SynCommons.pas(6661,23) Warning: Some fields coming after "" were not initialized
SynCommons.pas(13390,42) Warning: Some fields coming after "VType" were not initialized
SynCommons.pas(15038,56) Warning: Some fields coming after "VOptions" were not initialized
SynFPCTypInfo.pas(99,3) Fatal: Syntax error, "BEGIN" expected but "[" found

and the line in the unit is:

...
implementation

procedure FPCDynArrayClear(var a: Pointer; typeInfo: Pointer);
  [external name 'FPC_DYNARRAY_CLEAR'];
procedure FPCFinalizeArray(p: Pointer; typeInfo: Pointer; elemCount: PtrUInt);
  [external name 'FPC_FINALIZE_ARRAY'];
procedure FPCFinalize(Data: Pointer; TypeInfo: Pointer);
  [external name 'FPC_FINALIZE'];
procedure FPCRecordCopy(const Source; var Dest; TypeInfo: pointer);
  [external name 'FPC_COPY'];
procedure FPCRecordAddRef(var Data; TypeInfo : pointer);
  [external name 'FPC_ADDREF'];
...

I installed trunk version of Lazarus/FPC with FPCUpDeluxe 1.6.2x, using {$mode delphi}.

What am I doing wrong ?

Thanks.

Last edited by EMartin (2019-07-25 21:43:53)


Esteban

Offline

#2 2019-07-26 07:19:38

hnb
Member
Registered: 2015-06-15
Posts: 291

Re: Error compiling in Lazarus/FPC

Probably you should add to Synopse.inc the new directive:

{$modeswitch prefixedattributes-}

the problem is related to initial support of attributes in latest FPC trunk.


best regards,
Maciej Izak

Offline

#3 2019-07-26 11:09:35

EMartin
Member
From: Buenos Aires - Argentina
Registered: 2013-01-09
Posts: 332

Re: Error compiling in Lazarus/FPC

Thanks @hnb, that solve this error compilation, but now I have another:

"External: SIGSEGV" in this line:

..
if fElemType<>nil then begin
    {$ifndef HASDIRECTTYPEINFO}
    // FPC compatibility: if you have a GPF here at startup, your 3.1 trunk
    // revision seems older than June 2016
    // -> enable HASDIRECTTYPEINFO conditional below $ifdef VER3_1 in Synopse.inc
    // or in your project's options
    fElemType := PPointer(fElemType)^; // inlined DeRef() <-- THIS LINE
    {$endif HASDIRECTTYPEINFO}
    {$ifdef FPC}
    if not (PTypeKind(fElemType)^ in tkManagedTypes) then
      fElemType := nil; // as with Delphi
    {$endif FPC}
  end;
end;
..

I understand the warning comment but I downloaded, with FPCUpDeluxe, the trunk version (Lazarus 2.1.0 and FPC 3.3.1) ergo the revision is not that old.

What happend now ?

Thanks


Esteban

Offline

#4 2019-07-26 11:27:48

hnb
Member
Registered: 2015-06-15
Posts: 291

Re: Error compiling in Lazarus/FPC

No idea yet, this needs investigation. Probably some internal changes in RTTI layout (maybe even compiler bug). Try to use "fixes3.2" in fpcupdeluxe FPC Version instead of trunk.

Last edited by hnb (2019-07-26 11:35:03)


best regards,
Maciej Izak

Offline

#5 2019-07-26 11:35:12

EMartin
Member
From: Buenos Aires - Argentina
Registered: 2013-01-09
Posts: 332

Re: Error compiling in Lazarus/FPC

Ok, I'll use "fixes3.2" option from fpcupdeluxe.

A pity, whenever I try to initiate a migration to FPC some problem of this kind happens. My boss considers that these open source software are unstable, I try to convince him otherwise.

Thanks.


Esteban

Offline

#6 2019-07-26 11:39:09

hnb
Member
Registered: 2015-06-15
Posts: 291

Re: Error compiling in Lazarus/FPC

You cannot expect from trunk any stability. Only "patches/fixes" branch and "stable" releases are stable.

Last edited by hnb (2019-07-26 11:41:46)


best regards,
Maciej Izak

Offline

#7 2019-07-26 15:07:26

edwinsn
Member
Registered: 2010-07-02
Posts: 1,215

Re: Error compiling in Lazarus/FPC

@hnb,

Do you know where I can find descriptions for all these "versions"? Is "fixes3.2" the most recent AND stable release?

I know 'trunk' is the latest but not stable, but the 'stable' release is too far behind and sometimes cannot compile mORMot.

All I want is to choose the most recent but ALSO stable enough release to work with mORMot, is "fixes3.2" currently the best suit? Thanks.


Delphi XE4 Pro on Windows 7 64bit.
Lazarus trunk built with fpcupdelux on Windows with cross-compile for Linux 64bit.

Offline

#8 2019-07-28 02:36:38

EMartin
Member
From: Buenos Aires - Argentina
Registered: 2013-01-09
Posts: 332

Re: Error compiling in Lazarus/FPC

It works with FPC Fixes3.2 and Lazarus Fixes2.0, not works with FPC 3.3.1 and Lazarus 2.1.

"It works" mean that when added the SynCommons unit and run the project no error is raised.

Thanks @hnb.

PD: Is usefull try with FPC Fixes3.2 and Lazarus 2.1.0 ?


Esteban

Offline

#9 2019-07-28 03:07:23

edwinsn
Member
Registered: 2010-07-02
Posts: 1,215

Re: Error compiling in Lazarus/FPC

@EMartin, FPC is compiler while Lazarus is the IDE, so I guess the compilation error has nothing to do with Lazarus.

I just checked my fpcupdeluxe installation and it's Lazarus 2.1 which was installed many months ago.
And I just checked it was able to compile the mORMot I checked out few days ago.


Delphi XE4 Pro on Windows 7 64bit.
Lazarus trunk built with fpcupdelux on Windows with cross-compile for Linux 64bit.

Offline

#10 2019-07-28 12:46:30

hnb
Member
Registered: 2015-06-15
Posts: 291

Re: Error compiling in Lazarus/FPC

I don't know such page with detailed description of each FPC branch.

In general FPC "fixes3.2" seems like right choice for now. The stable 3.2 was not released yet and AFAIK the fixes3.2 is the base for incoming 3.2 stable release.

about Lazarus: Lazarus version has no meaning (it can be eventually more or less comfortable for end user including not working, but you should be able to use FPC from command line wink ). IMO always is worth to try new Lazarus for better UX.


best regards,
Maciej Izak

Offline

#11 2019-07-29 01:04:48

EMartin
Member
From: Buenos Aires - Argentina
Registered: 2013-01-09
Posts: 332

Re: Error compiling in Lazarus/FPC

With FPC Fixes3.2 and Lazarus trunk it works.


Esteban

Offline

Board footer

Powered by FluxBB