#1 2013-11-25 18:17:34

pult
Member
From: Ukraine, Kyiv
Registered: 2013-11-06
Posts: 18

SynCommons.pas - delphi package compilation error for asm code

If you try to create a package for the library mORMot:

Error: E2201 Need imported data reference ($G) to access 'VarCopyProc' from unit 'SynCommons'

temporary fix:

...
{$ifdef PUREPASCAL}
...
{$else}

procedure RecordCopyInvoke;
asm
  call System.@CopyRecord
end;

{+} // begin changes:
{.$IFDEF USESYNTABLEVARIANT}
procedure _VarCopyProc(var Dest: TVarData; const Source: TVarData);
begin
  System.VarCopyProc(Dest, Source); // AV when System.VarCopyProc = nil
end;
var
  VarCopyProc:   procedure (var Dest: TVarData; const Source: TVarData) = _VarCopyProc;
{.$ENDIF USESYNTABLEVARIANT}
{+.} // end changes.

procedure RecordCopy(var Dest; const Source; TypeInfo: pointer);
...

Offline

#2 2013-11-25 22:04:46

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

Re: SynCommons.pas - delphi package compilation error for asm code

Are you using the latest unstable 1.18 revision?
See http://synopse.info/files/mORMotNightlyBuild.zip

Did you try with the USEPACKAGES conditional defined for your project, as clearly stated by the doc?

Offline

#3 2013-11-26 10:57:06

pult
Member
From: Ukraine, Kyiv
Registered: 2013-11-06
Posts: 18

Re: SynCommons.pas - delphi package compilation error for asm code

Nightly - Yes
USEPACKAGES - Thanks - this solved the problem

Offline

Board footer

Powered by FluxBB