#1 2021-05-12 16:48:28

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

Need imported data reference ($G) to access 'SUPERVISOR_ACCESS_RIGHTS'

Reference for myself (and others might encounter the same issue in the future):

If you encounter the following error:

[dcc32 Error] E2201 Need imported data reference ($G) to access 'SUPERVISOR_ACCESS_RIGHTS' from unit 'mORMotHttpServer'

One of the reasons is because you are compiling a package which includes/uses a unit which in turn uses the `mORMot.pas' unit.

Solution
===
I have no solution yet. Maybe @ab has hints wink


Workaround
===
Just don't use the `mormot.pas` unit in your package...


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

Offline

#2 2021-05-12 18:45:46

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

Re: Need imported data reference ($G) to access 'SUPERVISOR_ACCESS_RIGHTS'

Did you try what is documented at https://synopse.info/files/html/Synopse … #MNDX_2503 ?
(I just search for "package" in keyword index of the documentation)

So, perhaps try to use the USEPACKAGES conditional for this project.

Offline

#3 2021-05-12 19:58:25

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

Re: Need imported data reference ($G) to access 'SUPERVISOR_ACCESS_RIGHTS'

the `USEPACKAGES` conditional was already in use smile


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

Offline

#4 2022-10-09 02:25:12

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

Re: Need imported data reference ($G) to access 'SUPERVISOR_ACCESS_RIGHTS'

So I found a solution for this issue.

According to the document: E2201 Need imported data reference ($G) to access '%s' from unit '%s' (Delphi)

The solution is to add the units that are missing imported data reference to the build-first package (which has the {$IMPORTEDDATA ON} directive).

For example, the following error is what I got today:

[dcc32 Error] E2201 Need imported data reference ($G) to access 'crcblock' from unit 'SynCrypto'
[dcc32 Error] E2201 Need imported data reference ($G) to access 'FillcharFast' from unit 'mORMot'

The solution was to add both SynCrypto.pas and mORMot.pas to my package that's supposed to be built and installed first.

Last edited by edwinsn (2022-10-09 02:36:07)


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

Offline

#5 2022-10-09 02:34:56

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

Re: Need imported data reference ($G) to access 'SUPERVISOR_ACCESS_RIGHTS'

More info on this:

1. Related, earlier discussion in this forum

2. Wiert's notes on this issue

Last edited by edwinsn (2022-10-09 09:16:28)


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

Offline

#6 2022-10-09 08:54:24

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

Re: Need imported data reference ($G) to access 'SUPERVISOR_ACCESS_RIGHTS'

So the units are included twice?

Offline

#7 2022-10-09 09:16:55

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

Re: Need imported data reference ($G) to access 'SUPERVISOR_ACCESS_RIGHTS'

ab wrote:

So the units are included twice?

No, just once, in the build-first package. As we know, a unit can only be included in one package.


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