#1 2018-05-06 23:37:45

JD
Member
Registered: 2015-08-20
Posts: 101

NewPascal 1.9 cannot compile mORMot programs

Hi there everyone,

I want to thank everyone that has made mORMot a wonderful framework for Delphi/Lazarus development. I've been using NewPascal 1.7 to develop a mORMot server for my Lazarus based clients.

Today I just used fpcupdeluxe to update my old NewPascal (with Lazarus IDE version I.7) to NewPascal (with Lazarus IDE version 1.9) and when I tried to recompile my program, I got the following error on line 724 in mORMotWrappers.pas

mORMotWrappers.pas(724,75) Error: Incompatible type for arg no. 2: Got "Variant", expected "TFileName"

I can no longer compile anything in mORMot because of this error. Even compiling the example programs fails.

Can anyone please help me get around this problem?

Cheers,

JD

Last edited by JD (2018-05-07 01:25:45)

Offline

#2 2018-05-07 06:30:49

AOG
Member
Registered: 2014-02-24
Posts: 490

Re: NewPascal 1.9 cannot compile mORMot programs

NewPascal got updated few hours ago.
I just did an install (NewPascal + mORMot) through GIT (with fpcupdeluxe) and all works out of the box.

Offline

#3 2018-05-07 06:53:19

JD
Member
Registered: 2015-08-20
Posts: 101

Re: NewPascal 1.9 cannot compile mORMot programs

Hi there Don Alfredo. I have an older version of mORMot on my system. Does this mean I have to update mORMot too?

Offline

#4 2018-05-07 06:57:47

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

Re: NewPascal 1.9 cannot compile mORMot programs

Probably good idea smile You can do update in 2 ways :

1. http://newpascal.org/download.html / https://github.com/newpascal/newpascal/ … np-v1.0.55
2. via fpcupdelux


best regards,
Maciej Izak

Offline

#5 2018-05-07 07:06:32

JD
Member
Registered: 2015-08-20
Posts: 101

Re: NewPascal 1.9 cannot compile mORMot programs

Hi there Maciej. Is mORMot integrated into NewPascal or can I continue to update mORMot using its regular download link?

If mORMot is in NewPascal, in what directory can i find it?

Thanks,

JD

Last edited by JD (2018-05-07 07:07:28)

Offline

#6 2018-05-07 07:26:26

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

Re: NewPascal 1.9 cannot compile mORMot programs

If you decide to use option 1 then mORMot is ready to use as part of newpascal.zip archive (is located in ccr\mORMot directory) and is detected "out of box" in IDE (you even don't need to configure a project).
If you decide to use option 2 then you need additional step: you can download mORMot via fpcupdelux or you can do download on your own (for example from : https://github.com/synopse/mORMot )


best regards,
Maciej Izak

Offline

#7 2018-05-07 07:29:20

mpv
Member
From: Ukraine
Registered: 2012-03-24
Posts: 1,539
Website

Re: NewPascal 1.9 cannot compile mORMot programs

Can you please post here a mORMotWrappers.pas line 724 content from your version?

Last edited by mpv (2018-05-07 07:29:47)

Offline

#8 2018-05-07 08:58:06

AOG
Member
Registered: 2014-02-24
Posts: 490

Re: NewPascal 1.9 cannot compile mORMot programs

Source: mORMot latest from GitHub.
Compiles with FPC trunk and NewPascal trunk.

FillDescriptionFromSource(fDescriptions,format('%s%s.pas',[fSourcePath[i], aUnitName]));

Offline

#9 2018-05-07 09:25:00

JD
Member
Registered: 2015-08-20
Posts: 101

Re: NewPascal 1.9 cannot compile mORMot programs

Ah! that is the problem. My mORMotWrappers.pas line 724 is different from what AOG posted.

Mine looks like this:

    FillDescriptionFromSource(fDescriptions,fSourcePath[i]+unitName+'.pas');

In addition, my project refers to mORMot stored in its own directory somewhere where it can be shared between NewPascal, Lazarus & Delphi.

So I guess the way forward would be to remove this external references/configuration and rely solely on the preconfigured NewPascal version (at least for future NewPascal projects).

JD

Last edited by JD (2018-05-07 09:26:07)

Offline

#10 2018-05-07 10:07:35

JD
Member
Registered: 2015-08-20
Posts: 101

Re: NewPascal 1.9 cannot compile mORMot programs

Hi all,

I'm going with NewPascal option 2 for the moment.

a) I used fpcupdeluxe to download and build NewPascal (07/05/2018)
b) I got a new version of mORMot from GitHub (07/05/2018)
c) I set everything up and compiled TestSQL3 successfully
d) I now went back to my project and tried to recompile it

I got the following error message in SynDBZeos.pas:

SynDBZeos.pas(1248,14) Error: identifier idents no member "ColumnsToJSON"

The line with the problem is as follows:

  {$if defined(ZEOS73UP) and defined(USE_SYNCOMMONS)}
  fResultSet.ColumnsToJSON(WR);
  {$ELSE}

The OPM tells me I'm using Zeos 7.3. How do I correct this problem?

Cheers,

JD

Last edited by JD (2018-05-07 10:09:37)

Offline

#11 2018-05-07 10:25:50

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

Re: NewPascal 1.9 cannot compile mORMot programs

Probably you need latest Zeos (I am not sure here), you can download proper/newest version of Zeos here : https://github.com/newpascal-ccr/zeos

Zeos will be part of next release of NewPascal like mORMot smile .


best regards,
Maciej Izak

Offline

#12 2018-05-07 10:38:58

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

Re: NewPascal 1.9 cannot compile mORMot programs

Sorry for my stupid questions, I started to use Lazarus/FPC throught fpcupdeluxe with trunk version and installing mORMot, Zeos, etc. with "Install Module" option de fpcupdeluxe. It is the best way or I must to use NewPascal ?

Thanks.


Esteban

Offline

#13 2018-05-07 11:30:06

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

Re: NewPascal 1.9 cannot compile mORMot programs

Both ways are good. Additional advantage of NewPascal is close cooperation with mORMot, so every change in critical parts of NewPascal (RTL, low level details) are handled in mORMot immediately. FPC trunk is also supported but in some situations update for mORMot may be delayed (and mix of FPC trunk and mORMot may be nonfunctional/full of bugs for some time).

Also NewPascal contains additional patches, bugfixes and features. For example "default field" feature or SmartPointers/ARC objects can be used only with NewPascal. I have also plan of special module dedicated for mORMot for extra features of NewPascal.

mORMot is freedom of choice smile


best regards,
Maciej Izak

Offline

#14 2018-05-07 13:13:30

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

Re: NewPascal 1.9 cannot compile mORMot programs

Thanks @hnb, I asked because I read the @ab blog (http://blog.synopse.info/post/2018/02/0 … C-with-FPC) and him use the trunk version of the FPC.


Esteban

Offline

#15 2018-05-07 18:42:59

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

Re: NewPascal 1.9 cannot compile mORMot programs

This was some time ago, when I was part of FPC core team and NewPascal was almost integrated with official FPC page... Now I have ban in FPC core mailing list and I don't have access to trunk anymore - there is no rational reason for my banishment... I am not able to provide any updates, bug fixes nor new features into FPC trunk. Political decision and revenge of one person in core team...

Anyway still nothing wrong with using FPC trunk instead of NewPascal - individual decision smile.

Last edited by hnb (2018-05-07 18:51:06)


best regards,
Maciej Izak

Offline

#16 2018-05-08 08:01:42

JD
Member
Registered: 2015-08-20
Posts: 101

Re: NewPascal 1.9 cannot compile mORMot programs

hnb wrote:

Probably you need latest Zeos (I am not sure here), you can download proper/newest version of Zeos here : https://github.com/newpascal-ccr/zeos

Zeos will be part of next release of NewPascal like mORMot smile .

There is still a problem somewhere. I did as you suggested and got Zeos from the link you provided but the result was the same.

I got the following error message as before in SynDBZeos.pas:

SynDBZeos.pas(1248,14) Error: identifier idents no member "ColumnsToJSON"

The line with the problem is as follows:

  {$if defined(ZEOS73UP) and defined(USE_SYNCOMMONS)}
  fResultSet.ColumnsToJSON(WR);
  {$ELSE}

However, when I edited line 61 of Zeos.inc and undefined USE_SYNCOMMONS like this:

{.$DEFINE USE_SYNCOMMONS} //enable JSON content support by using SynCommons.pas from Synopse project

I was then able to compile my project. So it looks like the problem comes from how Zeos 7.3 and above are supposed to use SynCommons.pas.

I was unable to locate the method ColumnsToJSON in SynCommons.pas so where is this method located?

Ideally, I would prefer to be able to export resultsets to JSON using ColumnsToJSON as expected.

While this "workaround" enabled me to compile my project, what are the side-effects in terms of speed of the REST server's
handling of queries?

Cheers,

JD

Last edited by JD (2018-05-08 08:05:47)

Offline

#17 2018-05-08 08:13:06

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,207
Website

Re: NewPascal 1.9 cannot compile mORMot programs

ColumnsToJSON is part of Zeos, not mORMot.
You enabled it by defining the conditional.

As side effect, it will be faster, since Zeos will directly generate the JSON for you.

Offline

#18 2018-05-08 08:29:21

JD
Member
Registered: 2015-08-20
Posts: 101

Re: NewPascal 1.9 cannot compile mORMot programs

ab wrote:

ColumnsToJSON is part of Zeos, not mORMot.
You enabled it by defining the conditional.

As side effect, it will be faster, since Zeos will directly generate the JSON for you.

Hi there ab,

I did not define the conditional. It was defined in the most recent version of Zeos that I downloaded from NewPascal GitHub. I have an older version of Zeos 7.3 alpha where it was undefined. I just verified that.

So what do I do now, I like the extra speed gains ColumnsToJSON will bring to my server? smile

Should we bring EgonHugeist/Michael into the picture?

Cheers,

JD

Last edited by JD (2018-05-08 08:38:39)

Offline

#19 2018-05-08 08:33:24

JD
Member
Registered: 2015-08-20
Posts: 101

Re: NewPascal 1.9 cannot compile mORMot programs

hnb wrote:

This was some time ago, when I was part of FPC core team and NewPascal was almost integrated with official FPC page... Now I have ban in FPC core mailing list and I don't have access to trunk anymore - there is no rational reason for my banishment... I am not able to provide any updates, bug fixes nor new features into FPC trunk. Political decision and revenge of one person in core team...

Anyway still nothing wrong with using FPC trunk instead of NewPascal - individual decision smile.

I read what you posted on the Lazarus forum and I was not happy. We are a small community and we need each other so that the project can move forward and stay alive.

Maybe you should accept Thaddy's offer of mediation so that we can get over this speedbump and move forward.

JD

Offline

#20 2018-05-08 09:34:57

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

Re: NewPascal 1.9 cannot compile mORMot programs

@hnb,

What were you banned and can you point me to the page of the relative discussion?


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

Offline

#21 2018-05-08 09:51:02

EgonHugeist
Member
From: Germany
Registered: 2013-02-15
Posts: 190

Re: NewPascal 1.9 cannot compile mORMot programs

Hi JD,

{$if defined(ZEOS73UP) and defined(USE_SYNCOMMONS)}
  fResultSet.ColumnsToJSON(WR);
  {$ELSE}
...

as Arnaud wrote: the IZResultSet.ColumnsToJSON is part of Zeos, defined in ZDbcIntfs.pas.
It skips the interface calling chain and brings best performance per driver to write the JSON contents.

I wonder about your regression. As the define shows, you can use the procedure only if both defines are enabled.
The ZEOS73UP define is located in Zeos.inc (included in SynDBZeos.pas) and available only in the 7.3 branches. 
Secondary define is your choice to define it in your Project.

Check old revisions of zeos on your computer. It looks to me like your mixing old files somewhere. Check the USE_SYNCOMMONS define too. 

@hnb
great news for Zeos, thank to all.

Offline

#22 2018-05-08 10:05:29

JD
Member
Registered: 2015-08-20
Posts: 101

Re: NewPascal 1.9 cannot compile mORMot programs

EgonHugeist wrote:

Hi JD,

{$if defined(ZEOS73UP) and defined(USE_SYNCOMMONS)}
  fResultSet.ColumnsToJSON(WR);
  {$ELSE}
...

as Arnaud wrote: the IZResultSet.ColumnsToJSON is part of Zeos, defined in ZDbcIntfs.pas.
It skips the interface calling chain and brings best performance per driver to write the JSON contents.

I wonder about your regression. As the define shows, you can use the procedure only if both defines are enabled.
The ZEOS73UP define is located in Zeos.inc (included in SynDBZeos.pas) and available only in the 7.3 branches. 
Secondary define is your choice to define it in your Project.

Check old revisions of zeos on your computer. It looks to me like your mixing old files somewhere. Check the USE_SYNCOMMONS define too. 

@hnb
great news for Zeos, thank to all.


Hi there Michael,

I am talking about 3 separate computers here. My Windows 7 laptop has the newest NewPascal, mORMot and Zeos, that is the one on which I am trying to get ColumnsToJSON to work.

My Windows 7 desktop has older versions of all three, all is well over there as it does not use ColumnsToJSON (I checked it) smile. On my desktop the line 61 of Zeos.inc was undefined by default.

I have a third Linux laptop with older versions where compilation is OK there too.

I still persist in saying I did not define USE_SYNCOMMONS in line 61 of Zeos.inc of the Zeos version I downloaded this morning.

Cheers,

JD

EDIT: Sorry I reported your post by mistake smile

Last edited by JD (2018-05-08 10:15:58)

Offline

#23 2018-05-08 10:38:00

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

Re: NewPascal 1.9 cannot compile mORMot programs

edwinsn wrote:

@hnb,

What were you banned and can you point me to the page of the relative discussion?

to get full picture you need to track April/May mailing list archives (you can read all discussion by clicking "Next message (by thread)" in bottom):

http://lists.freepascal.org/pipermail/f … 38863.html
http://lists.freepascal.org/pipermail/f … 38880.html

after my last message I have got permanent ban smile - I have no access to SVN FPC repository/trunk nor internal "core mailing list".

TLTR, the general summary (this was not first situation):

http://lists.freepascal.org/pipermail/f … 38893.html

Last edited by hnb (2018-05-08 10:56:23)


best regards,
Maciej Izak

Offline

#24 2018-05-08 13:26:19

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

Re: NewPascal 1.9 cannot compile mORMot programs

Hi Maciej,

I had a quick look, and I'm sorry to hear that. All after all, I appreciate all of you for all your great works in the pascal community smile


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

Offline

Board footer

Powered by FluxBB