[fpc-pascal] will be work macro with name of the unit?

Michael Van Canneyt michael at freepascal.org
Fri Jul 17 12:01:44 CEST 2015



On Fri, 17 Jul 2015, Sven Barth wrote:

> 
> Am 17.07.2015 08:12 schrieb "ulrich" <romrum at cbox.cz>:
> >
> > Dne 15.7.2015 v 10:16 Michael Van Canneyt napsal(a):
> >
> >>
> >>
> >> On Tue, 14 Jul 2015, ulrich wrote:
> >>
> >>> Hi,
> >>>
> >>> I have this unit, but when I compile it, I get this error:
> >>>
> >>> Illegal unit name XXX_Parser. The unit is saved under dfm_rrparser.pas.
> >>
> >>
> >> The unit name must always match the file name. This is logical, because
> >> otherwise the compiler can never find it if a reference to the unit is
> >> made in a uses clause.
> >>
> > I understand this. I thought that the compiler searches the unit by file name and unit name is stored inside the unit. Test if it is desired unit would be trivial - but I guess you're right - it would
> be pointless.
> 
> There is a compiler parameter to disable that restriction (check the help output, I don't remember the parameter right now), but it's definitely less tested...

-Un, but it is only meant for the system unit, it should not be used for other files.

Michael.



More information about the fpc-pascal mailing list