Constructor must be init - how to get rid of this? lazarus / 65-FV-Textmode IDE ---------------------------------------------------------------------- pik33 · 2022-07-29 13:58 I have a Linux console/framebuffer/non-x project so why using X and Lazarus to develop while I don't want any X to be there? I tried to move the project to fp Then I got "Constructor name must be init" compiler error... and I didn't find where fp keeps fpc command line parameters to to change this behavior. Where I should search for this? This is Raspberry Pi OS, 64-bit ARM. ---------------------------------------------------------------------- Awkward · 2022-07-29 14:19 i thinked what this error is for "Object" types only... anyway, this is next FPC option: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i -Ss        Constructor name must be init (destructor must be done) ---------------------------------------------------------------------- pik33 · 2022-07-29 14:23 Yes, I know, this is -Ss, but where fp keeps this so I can remove this option from there? ---------------------------------------------------------------------- marcov · 2022-07-29 15:06 -S2h ---------------------------------------------------------------------- Thaddy · 2022-07-29 15:13 Either {$mode delphi} or {$mode objfpc} will solve the issue. Other modes, like {$mode tp} or {$mode fpc}, the default, will trigger it. That's because in these modes the objpas unit is not loaded. That is documented. It is a bit strange, since the objfpc unit pulls in classes, but old school objects do not need it, provided constructor /destructor are named init/done. ---------------------------------------------------------------------- PascalDragon · 2022-07-29 15:33 Quote from: Thaddy on July 29, 2022, 05:13:06 pmEither {$mode delphi} or {$mode objfpc} will solve the issue. Other modes, like {$mode tp} or {$mode fpc}, the default, will trigger it. That's because in these modes the objpas unit is not loaded. That is documented. It is a bit strange, since the objfpc unit pulls in classes, but old school objects do not need it, provided constructor /destructor are named init/done. No, the -Ss switch is independent of the mode. The {$mode ...} directive will not reset it. ---------------------------------------------------------------------- Thaddy · 2022-07-29 15:48 Quote from: PascalDragon on July 29, 2022, 05:33:53 pmNo, the -Ss switch is independent of the mode. The {$mode ...} directive will not reset it. The message only shows up if objpas is not included. ---------------------------------------------------------------------- pik33 · 2022-07-29 20:49 There is {$mode objfpc}  at start of the main program and the unit which has the error. If not, this thing doesnt even accept a class. ---------------------------------------------------------------------- PascalDragon · 2022-07-31 12:25 Quote from: Thaddy on July 29, 2022, 05:48:47 pmQuote from: PascalDragon on July 29, 2022, 05:33:53 pmNo, the -Ss switch is independent of the mode. The {$mode ...} directive will not reset it. The message only shows up if objpas is not included. You're wrong. This message only shows up if the -Ss option is given to the compiler, cause that's how it's implemented in the source. Just search for cs_constructor_name and you'll see that it's only changed with the option (or with -S-, but that's only for disabling it). Quote from: pik33 on July 29, 2022, 10:49:33 pmThere is {$mode objfpc}  at start of the main program and the unit which has the error. If not, this thing doesnt even accept a class. The text mode IDE keeps the settings in a fp.cfg file, though I don't know right now which locations the IDE looks for (one at least is the current directory from which the IDE is started).