Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2026-09

Building woes...

5 messages · 3 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Michael Van Canneyt

Hi,

When doing a rebuild of lazarus, build fails with:

procedure TCheckCompilerOptsDlg.CopyOutputMenuItemClick(Sender: TObject);
var
   s: String;
   TVNode: TTreeNode;
begin
   s:='';
   for TVNode in OutputTreeView.Items do
     s+=TVNode.Text+LineEnding; // assumes -Sc
   Clipboard.AsText:=s;
end;

That's because it assumes -Sc and -Sc is nowhere set in my environment. I added it to the options of 'build lazarus' and then it works, but I think this needs to be added somewhere so the user does not need to add it.

Michael.

Reply by email

n7800
to Michael Van Canneyt

Indeed, if remove "-Sc" from "fpc.cfg", the build fails.

However, the main oddity is that the "C style operators" option is checked in the "lazarus.lpi" project settings, so I expected it to work. Apparently, these options are ignored by the IDE itself and are only applied via the "Tools >?Configure Build Lazarus" window.

I checked, and C-style operators are used in many places throughout the IDE code (project,?not packages). In some instances, replacing them with standard operators would indeed make the code harder to read.?One option would be to add a directive to the code for those units, but even then, there would be a dozen or two of them.?Therefore, it is better to enable the option at the project level.

Show quoted text 5 lines
That's because it assumes -Sc and -Sc is nowhere set in my environment. I added it to the options of 'build lazarus' and then it works, but I think this needs to be added somewhere so the user does not need to add it.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20260924/75765bec/attachment.htm>

Reply by email

Michael Van Canneyt
to n7800
Show quoted text 10 lines
Indeed, if remove "-Sc" from "fpc.cfg", the build fails. However, the main oddity is that the "C style operators" option is checked in the "lazarus.lpi" project settings, so I expected it to work. Apparently, these options are ignored by the IDE itself and are only applied via the "Tools >?Configure Build Lazarus" window. I checked, and C-style operators are used in many places throughout the IDE code (project,?not packages). In some instances, replacing them with standard operators would indeed make the code harder to read.?One option would be to add a directive to the code for those units, but even then, there would be a dozen or two of them.?Therefore, it is better to enable the option at the project level.

Here it failed in one of the packages - so better make sure it is in the (correct) packages as well. I suppose the options set in the build lazarus config as well.

When I compiled on the command-line with make, I had to add it to the options as well: OPT=-Sc

Michael.

Reply by email

Juha Manninen
to Michael Van Canneyt

n7800 via lazarus kirjoitti 24.9.2026 klo 3.56:

However, the main oddity is that the "C style operators" option is checked in the "lazarus.lpi" project settings, so I expected it to work. Apparently, these options are ignored by the IDE itself and are only applied via the "Tools >?Configure Build Lazarus" window.

Yes, "lazarus.lpi" cannot be used for building the IDE. The reasons deal with the widgetset system etc.
It would be ideal to build the Lazarus project just like any other project. Makefiles and the build system inside the IDE are separate systems.

Michael Van Canneyt via lazarus kirjoitti 24.9.2026 klo 9.24:

When I compiled on the command-line with make, I had to add it to the options as well: OPT=-Sc

AFAIK it is included in the makefiles already. At least I can run "make" for Lazarus without adding anything.

Juha

Reply by email

Michael Van Canneyt
to Juha Manninen
Juha Manninen wrote 17 lines
n7800 via lazarus kirjoitti 24.9.2026 klo 3.56: > However, the main oddity is that the "C style operators" option is > checked in the "lazarus.lpi" project settings, so I expected it to > work. Apparently, these options are ignored by the IDE itself and are > only applied via the "Tools >?Configure Build Lazarus" window. Yes, "lazarus.lpi" cannot be used for building the IDE. The reasons deal with the widgetset system etc. It would be ideal to build the Lazarus project just like any other project. Makefiles and the build system inside the IDE are separate systems. Michael Van Canneyt via lazarus kirjoitti 24.9.2026 klo 9.24: > When I compiled on the command-line with make, I had to add it to the > options as well: OPT=-Sc AFAIK it is included in the makefiles already. At least I can run "make" for Lazarus without adding anything.

Probably because -Sc is in your fpc.cfg, but you cannot count on it that this will be so for all users. For me, it is not in there.

The best solution is to do

{$COPERATORS ON}

wherever you use them

This is a documented directive, see https://www.freepascal.org/docs-html/current/prog/progsu10.html

As with all language features, it is better to enable/disable them in source, this way it will always compile, no matter what the environment says.

Michael.

Reply by email