Forum > FV/Textmode IDE

Constructor must be init - how to get rid of this?

<< < (2/2)

PascalDragon:

--- Quote from: Thaddy on July 29, 2022, 05:13:06 pm ---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.

--- End quote ---

No, the -Ss switch is independent of the mode. The {$mode ...} directive will not reset it.

Thaddy:

--- Quote from: PascalDragon on July 29, 2022, 05:33:53 pm ---No, the -Ss switch is independent of the mode. The {$mode ...} directive will not reset it.

--- End quote ---
The message only shows up if objpas is not included.

pik33:
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:

--- Quote from: Thaddy on July 29, 2022, 05:48:47 pm ---
--- Quote from: PascalDragon on July 29, 2022, 05:33:53 pm ---No, the -Ss switch is independent of the mode. The {$mode ...} directive will not reset it.

--- End quote ---
The message only shows up if objpas is not included.

--- End quote ---

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 pm ---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.

--- End quote ---

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).

Navigation

[0] Message Index

[*] Previous page

Go to full version