You are not logged in.
If you try to create a package for the mORMot:
[DCC Error] SynCommons.pas(1): E2234 Getter or setter for property 'Count' cannot be found
I'm using the latest NightlyBuild revision:
http://synopse.info/files/mORMotNightlyBuild.zip
Of course i'm defined the USEPACKAGES conditional in my project options.
My package source:
package Package1;
{$R *.res}
{$ALIGN 8}
{$ASSERTIONS ON}
{$BOOLEVAL OFF}
{$DEBUGINFO ON}
{$EXTENDEDSYNTAX ON}
{$IMPORTEDDATA ON}
{$IOCHECKS ON}
{$LOCALSYMBOLS ON}
{$LONGSTRINGS ON}
{$OPENSTRINGS ON}
{$OPTIMIZATION ON}
{$OVERFLOWCHECKS OFF}
{$RANGECHECKS OFF}
{$REFERENCEINFO ON}
{$SAFEDIVIDE OFF}
{$STACKFRAMES OFF}
{$TYPEDADDRESS OFF}
{$VARSTRINGCHECKS ON}
{$WRITEABLECONST OFF}
{$MINENUMSIZE 1}
{$IMAGEBASE $400000}
{$IMPLICITBUILD ON}
{$DEFINE USEPACKAGES}
requires
rtl;
contains
HTTPDB.Server in 'HTTPDB.Server.pas';
end.
My unit code:
unit HTTPDB.Server;
interface
uses
SynDBVCL,
SynDB,
SynDBDataset,
SynDBFireDAC,
SynDBRemote,
SynVirtualDataset,
SynCommons;
type
THttpDbServer = class
strict private
FDBConnectionProp: TSQLDBConnectionProperties;
FHttpServer : TSQLDBServerHttpApi;
function GetDBConnectionProp: TSQLDBConnectionProperties;
function GetHttpServer : TSQLDBServerHttpApi;
public
procedure BeforeDestruction; override;
property DBConnectionProp: TSQLDBConnectionProperties read GetDBConnectionProp;
property HttpServer : TSQLDBServerHttpApi read GetHttpServer;
end;
implementation
uses
uADPhysIB;
procedure THttpDbServer.BeforeDestruction;
begin
inherited;
FHttpServer.Free;
FDBConnectionProp.Free;
end;
function THttpDbServer.GetDBConnectionProp: TSQLDBConnectionProperties;
begin
if not Assigned(FDBConnectionProp) then
FDBConnectionProp := TSQLDBFireDACConnectionProperties.Create('IB?CharacterSet=WIN1250', '127.0.0.1:C:\NX\DATA.FDB', 'SYSDBA', 'masterkey');
Result := FDBConnectionProp;
end;
function THttpDbServer.GetHttpServer: TSQLDBServerHttpApi;
begin
if not Assigned(FHttpServer) then
FHttpServer := TSQLDBServerHttpApi.Create(DBConnectionProp, 'FB', '8092', 'user', 'pass');
Result := FHttpServer;
end;
end.
Thank you for your help!
Offline
Your code won't compile as such (the override in THttpDBServer).
There is a missing parent class, obviously.
I tried to create a package containing SynCOMmons.pas, SynDB.pas and mORMot.
No problem with Delphi 7 and Delphi XE7.
Which version of the compiler are you using?
What if you put just SynCommons in your package?
Did you know what object/class this "count" is member of?
Try to disable HASINLINE conditional in Synopse.inc.
Offline
Your code won't compile as such (the override in THttpDBServer).
There is a missing parent class, obviously.
I don't think so ;-)
Please check yourself, here you can download the package:
http://www.dflex.pl/dflex-ftp/mORMot_Package.zip
I tried to create a package containing SynCOMmons.pas, SynDB.pas and mORMot.
No problem with Delphi 7 and Delphi XE7.
Strange...
Which version of the compiler are you using?
Delphi XE Pro
What if you put just SynCommons in your package?
No changes...
Did you know what object/class this "count" is member of?
Unfortunately, no.
Delphi raise error with SynCommons.pas(1)
What is total bull...t, because the first line of the SynCommons.pas does not have any error...
Try to disable HASINLINE conditional in Synopse.inc.
Unfortunately, then exactly the same error.
Last edited by wloochacz (2015-01-04 17:09:00)
Offline
I have no problem to compile your package with Delphi XE7.
My IDE added the following references:
requires
rtl,
vcl,
dbrtl,
FireDACCommon,
FireDACCommonDriver,
FireDAC;
Offline
I have no problem to compile your package with Delphi XE7.
My IDE added the following references:
requires rtl, vcl, dbrtl, FireDACCommon, FireDACCommonDriver, FireDAC;
... and implicity import all mORMmot units. That's normal.
OK, but package not working in Delphi XE.
Please, any idea?
Offline
@wloochacz, @ab,
In my Delphi XE2-32 it looks so:
requires
rtl,
vcl,
xmlrtl,
dbrtl,
AnyDAC_Phys_D16,
AnyDAC_ComI_D16,
AnyDAC_PhysIB_D16,
AnyDAC_Comp_D16;
and it works.
Michal
Offline
Maybe XE bug - i don't know...
But, there is workaround (SynCommons.pas):
class TSynCache
property property Count: integer read fNameValue.Count;
I changed to:
property Count: integer read GetCount;
Where GetCount is:
function TSynCache.GetCount: integer;
begin
Result := fNameValue.Count;
end;
And now i'ts working!
Arnaud can you confirm this?
Offline
Should be fixed by http://synopse.info/fossil/info/f89f7d899
Thanks a lot for finding out the root cause!
Circumventing all limitations/issues of all Delphi compilers is really a nightmare, and very time consuming!
Thanks again
Offline
Should be fixed by http://synopse.info/fossil/info/f89f7d899
Now is OK!
Thanks a lot for finding out the root cause!
Circumventing all limitations/issues of all Delphi compilers is really a nightmare, and very time consuming!
Thanks again
No, no - I thank you very much!
PS.
Now only remains to implement interface-based callbacks and will be great! ;-)
Offline
Hello
I downloaded SynPDF a few days ago and the same problem is still there.
I have followed the instructions, modified code and now it works perfectly.
Alberto
Offline
I just download again the version here http://synopse.info/fossil/wiki?name=PDF+Engine and here https://github.com/synopse/SynPDF. The sources are slightly different but they have the same issue on XE2.
I solved the issue by changing the following source
{$ifdef VER220} { circumvent Delphi XE compilation with packages }
function Count: integer;
{$else}
property Count: integer read fNameValue.Count;
{$endif}
into
{$ifdef VER220} { circumvent Delphi XE compilation with packages }
function Count: integer;
{$else}
property Count: integer read GetCount;
{$endif}
and by adding
function TSynCache.GetCount:Integer;
begin
Result := fNameValue.Count;
end;
This way I can compile
Offline
Should work now with http://synopse.info/fossil/info/c3412aca34
Offline