[fpc-pascal]Where is the error?

Michael.VanCanneyt at Wisa.be Michael.VanCanneyt at Wisa.be
Wed Sep 1 13:40:38 CEST 2004


On Wed, 1 Sep 2004, Olle Raab wrote:

> 04-09-01 09.29, skrev Michael.VanCanneyt at Wisa.be följande:
> 
> > 
> > 
> > On Wed, 1 Sep 2004, Marc Santhoff wrote:
> > 
> >> Am Di, den 31.08.2004 schrieb Michalis Kamburelis um 22:25:
> >>> When you compile using -S2 parameter you are compiling in objfpc mode.
> >>> This mode is not exactly compatible with Delphi. In this particular
> >>> case, the problem is that in objfpc mode method parameters can't have
> >>> the same name as the object properties and fields (that's what
> >>> "Duplicate identifier ..." errors mean). That's often very nice
> >>> safety-check, however it makes many Delphi code invalid in objfpc mode.
> >>> 
> >>> Solution is to compile in delphi mode:
> >>> fpc -Mdelphi mat.pas
> >>> works OK.
> >> 
> >> This leads me to the question:
> >> 
> >> Is it "legal" to link together objects compiled in different modes? (I
> >> haven't tried if it is possible at all ...)
> >> 
> >> For example Alan would compile his matrix stuff in delphi mode and link
> >> to other object files compiled in objpas mode?
> > 
> > This is not a problem. The generated code is the same, independent of the
> > mode. The mode only affects the parsing, and how identifiers are
> > interpreted.
> 
> But can Delphi classes be used if you are in e g TP mode ?

No. You need objfpc or delphi mode for that.

Michael.




More information about the fpc-pascal mailing list