Recent

Author Topic: [Solved]Lazarus problem with mORMot  (Read 4671 times)

larand54

  • Newbie
  • Posts: 5
[Solved]Lazarus problem with mORMot
« on: March 13, 2019, 01:08:51 pm »
I can not compile the testproject "TestSQL3" I get the following error:

Compile Project, Mode: win32, Target: fpc\bin\i386-win32\TestSQL3.exe: Exit code 1, Errors: 2, Warnings: 2
SynCommons.pas(6606,23) Warning: Some fields coming after "" were not initialized
SynCommons.pas(13848,42) Warning: Some fields coming after "VType" were not initialized
SynFPCTypInfo.pas(92,26) Error: Identifier not found "PRecInitData"
SynFPCTypInfo.pas(92,38) Error: Error in type definition


Lazarus version 1.8.4
FPC version 3.0.4

What can I do about that?
« Last Edit: March 20, 2019, 08:09:52 am by larand54 »

BSaidus

  • Hero Member
  • *****
  • Posts: 541
  • lazarus 1.8.4 Win8.1 / cross FreeBSD
Re: Lazarus problem with mORMot
« Reply #1 on: March 13, 2019, 08:02:36 pm »
I can not compile the testproject "TestSQL3" I get the following error:

Compile Project, Mode: win32, Target: fpc\bin\i386-win32\TestSQL3.exe: Exit code 1, Errors: 2, Warnings: 2
SynCommons.pas(6606,23) Warning: Some fields coming after "" were not initialized
SynCommons.pas(13848,42) Warning: Some fields coming after "VType" were not initialized
SynFPCTypInfo.pas(92,26) Error: Identifier not found "PRecInitData"
SynFPCTypInfo.pas(92,38) Error: Error in type definition


What can I do about that?



You can not compile it with FPC 3.0.4
you must use FPC 3.2 Fixes or trunk


« Last Edit: March 13, 2019, 08:06:08 pm by BSaidus »
lazarus 1.8.4 Win8.1 / cross FreeBSD
dhukmucmur vernadh!

larand54

  • Newbie
  • Posts: 5
Re: Lazarus problem with mORMot
« Reply #2 on: March 14, 2019, 12:32:03 am »
I'm new to fpc and Lazarus  and have no idea how to handle un upgrade on Lazarus with fpc from vs 3.04 to 3.2. I need some help. %)

hnb

  • Sr. Member
  • ****
  • Posts: 270
Re: Lazarus problem with mORMot
« Reply #3 on: March 14, 2019, 01:52:26 am »
for simply start you can download NewPascal at http://newpascal.org/download.html (should be good enough for start). It contains pre-installed ready to use mORMot:

1. Just download zip file
2. unpack
3. run configure.bat
4. run run.bat
5. enjoy & happy coding

you can also try to play with fpcupdelux
Checkout NewPascal initiative and donate beer - ready to use tuned FPC compiler + Lazarus for mORMot project

best regards,
Maciej Izak

valdir.marcos

  • Hero Member
  • *****
  • Posts: 1106
Re: Lazarus problem with mORMot
« Reply #4 on: March 14, 2019, 02:35:06 am »
I'm new to fpc and Lazarus  and have no idea how to handle un upgrade on Lazarus with fpc from vs 3.04 to 3.2. I need some help. %)
The easiest solution:

fpcupdeluxe - Lazarus wiki
http://wiki.lazarus.freepascal.org/fpcupdeluxe

larand54

  • Newbie
  • Posts: 5
Re: Lazarus problem with mORMot
« Reply #5 on: March 18, 2019, 09:21:01 am »
 I tested with newpascal and I got rid of that problem but a new problem arised :(
When adding library "mORMot to the uses clause I get the following message when compile:
"srvTicket.lpr(19,1) Error: Can't open object file: libmsvcrt.a"

The unit that uses it looks like this:
Code: Pascal  [Select][+][-]
  1. unit uDDDticket;
  2.  
  3. {$I Synopse.inc} // define HASINLINE USETYPEINFO CPU32 CPU64 OWNNORMTOUPPER
  4.  
  5. interface
  6.  
  7. uses
  8.   {$I SynDprUses.inc} // use FastMM4 on older Delphi, or set FPC threads
  9.   Classes, SysUtils,
  10.   SynCommons
  11.   ,SynTests
  12.   ,mORMot
  13. //  ,mORMotDDD
  14.   ;
  15.  type
  16.   TDescription = type RawUTF8;
  17.   TTicketNo = type integer;
  18.   TTicketID = type RawUTF8;
  19. (*
  20.   { TTicket }
  21.  
  22.   TTicket = class(TSQLRecord)
  23.   private
  24.     fTicketNo: TTicketNo;
  25.     fDescription : TDescription;
  26.     function getTicketID: TTicketID;
  27.   published
  28.     property ticketNo: TTicketNo read fTicketNo;
  29.     property id: TTicketID read getTicketID;
  30.   end;
  31.   *)
  32. implementation
  33.  
  34. { TTicket }
  35. (*
  36. function TTicket.getTicketID: TTicketID;
  37. begin
  38. //  result := format('T%3d',[fTicketNo]);
  39. end;
  40.   *)
  41. end.
  42.  

So you can see I have commented code part by part until I found that it was the mormot unit that causes this error.

larand54

  • Newbie
  • Posts: 5
Re: Lazarus problem with mORMot
« Reply #6 on: March 18, 2019, 11:29:02 pm »
Sorry :-[  I found my mistake. I had an error in my unit-path. With that fixed I got the next problem:

Error message: "mORMot.pas(4186,15) Error: There is no method in an ancestor class to be overridden: "AddInstancePointer(TObject;Char;Boolean);

And the code pointed out is in...
Code: Pascal  [Select][+][-]
  1.   TJSONSerializer = class(TJSONWriter)
  2.  protected
  3. .
  4. .
  5.     procedure AddInstancePointer(Instance: TObject; SepChar: AnsiChar;
  6.       IncludeUnitName: boolean); override;
  7.  

I believe it is something with the compiler switches that's wrong.. but which?
I have no idea about that, I tried with a few but no good result.

larand54

  • Newbie
  • Posts: 5
Re: Lazarus problem with mORMot
« Reply #7 on: March 20, 2019, 08:07:22 am »
Ok, I failed with NewPascal but I tried fpcupDeluxe instead and finally made it work with mORMot.
I selected the trunk versions of both fpc and Lazarus and then I downloaded mORMot using fpcupDeluxe.
Then I had to setup both unit-path and include-path correctly to be able to use mORMot. That's it folks.
 8-)

 

TinyPortal © 2005-2018