Code works on FPC (IDE) but not in Lazarus IDE lazarus / 12-Debugger ---------------------------------------------------------------------- AkiFoblesia · 2006-09-04 00:54 Hello to all im starting studying lazarus hand in hand with freepascal. im wondering why in a given unit w/ two class types - where one is a subclass of the other - having a field (or variable) of similar names would cause lazarus (0.9.16 beta) to complain of duplicate identifier while free pascal (2.0.4) would accept the same code. my code was used under 'Delphi compatibility option' for both fpc and lazarus. for example, the following code snippet will be accepted by FPC IDE but lazarus would complain of duplicate identifier, which is 'ID'. =================================== interface {section} type   MyClass = class     ID : integer;     procedure MyProc;   end;     NewClass = class(MyClass)     ID : string;   end; {lazarus complains the second 'ID' of being a duplicate identifier; fpc does not and compiles successfully. If I change the second ID variable in another name w/c is unique, lazarus would then compile the code succesfully.} =================================== btw, the project was a custom program for lazarus, selected on 'Project -> New Project -> Custom Program'. thanks in advance for the answer ---------------------------------------------------------------------- CCRDude · 2006-09-04 08:03 From memory, so it might not be exactly correctly, but if you use the IDE, I think something like {$MODE OBJFPC} or similar is predefined, while compiling with fpc, you would have to define it yourself? ---------------------------------------------------------------------- AkiFoblesia · 2006-09-04 08:23 that gave me an idea. lazarus ide has the {$MODE OBJFPC}{$H+} pre-written in both progam and unit files. i tried deleting the {$MODE OBJFPC} and it accepted the code