Forum > General

RTL Namespaces

(1/7) > >>

deadserious:
I'm trying to compile some Delphi units in FPC and running into an issue where the System namespace is unknown.  Units like System.SysUtils, System.DateUtils, System.IOUtils, etc aren't found.  I'm guessing based on the file names in the units/rtl folder you haven't yet namespaced your RTL units in FPC?

How can we tell FPC that System.* should alias to units without System namespace?  Or is there a different RTL I should be pointing to that is already namespaced to match Delphi?

PascalDragon:

--- Quote from: deadserious on June 15, 2022, 05:23:18 am ---I'm guessing based on the file names in the units/rtl folder you haven't yet namespaced your RTL units in FPC?
--- End quote ---

Correct.


--- Quote from: deadserious on June 15, 2022, 05:23:18 am ---How can we tell FPC that System.* should alias to units without System namespace?
--- End quote ---

You can't.


--- Quote from: deadserious on June 15, 2022, 05:23:18 am ---Or is there a different RTL I should be pointing to that is already namespaced to match Delphi?

--- End quote ---

There isn't.

deadserious:
If I were to take on the effort of renaming RTL units to their namespace, would that be a welcome PR for the team? 

Or is there no interest in Delphi namespace compatibility?

Thaddy:
If the dot would be supported in FPC's macro facility, it could come a long way.

marcov:
It's a well known issue.  If a change will be made, it will only be made near a major version transition to keep the transition period as short as possible, I will put it on the major version checklist.

However there are probably also certain legacy target concerns, since it possibly eats into their maximum filepath. That discussion still must be had (short term desirability).

(I hope that since you use Delphi, I don't have to tell you how intrusive those changes are)

I simply work the other way, I enter the skip namespace tag in Delphi, and rename all my units on that side.

Navigation

[0] Message Index

[#] Next page

Go to full version