Author Topic: LazBuild defaults to Carbon,  (Read 2208 times)


  • Full Member
  • ***
  • Posts: 229
LazBuild defaults to Carbon,
« on: July 28, 2021, 10:42:51 pm »
I can create a new project with Lazarus on macOS: Project/NewProject menu item, select "Application". When I choose run, it happily compiles a Cocoa 64-bit application.

Now I use lazbuild from the command line:

$ lazbuild project1.lpi
Free Pascal Compiler version 3.3.1 [2021/06/08] for aarch64
Copyright (c) 1993-2021 by Florian Klaempfl and others
(1002) Target OS: Darwin for AArch64
(3104) Compiling lcl.pas
(3104) Compiling ./carbon/alllclintfunits.pas
(3104) Compiling ./carbon/carbonbars.pp
/Users/chrisrorden/src/lazarus/lcl/interfaces/./carbon/carbonbars.pp(16,2) Error: (2023) User defined: only 32 bit cpu is supported
(3104) Compiling ./carbon/carbonprivate.pp
(3104) Compiling ./carbon/carbondef.pp
/Users/chrisrorden/src/lazarus/lcl/interfaces/./carbon/carbondef.pp(187,1) Fatal: (10026) There were 1 errors compiling module, stopping
Fatal: (1018) Compilation aborted
Error: /usr/local/bin/ppca64 returned an error exitcode
Error: (lazarus) Compile package LCL 2.3: stopped with exit code 1
Error: (lazarus) [TLazPackageGraph.CompileRequiredPackages] "Exit code 1"
Error: (lazbuild) Project dependencies of /Users/chrisrorden/src/a1/project1.lpi

Note that it attempts to build to the Carbon widget set, which does not support 64-bit code. TO successfully compile on my ARM-based Apple Silicon Mac I must explicitly request the Cocoa widgetset:

$ lazbuild --ws=cocoa project1.lpi

will compile correctly.

I think that lazbuild should target Cocoa by default, this would match the defaults of Lazarus and it does not seem that carbon is actively maintained anymore. Regardless, Cocoa is required for a 64-bit compile.

p.s. I am using trunk, but I think this behavior is consistent with all versions.


  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1679
  • Former Delphi 1-7, 10.2 user
Re: LazBuild defaults to Carbon,
« Reply #1 on: July 29, 2021, 03:08:53 am »
I'd log a bug, but you may have to wait until the GitLab move is completed successfully.

If it occurs with Lazarus 2.2 RC1, then you could post in the Lazarus Release Candidate 1 of 2.2.0 thread - simply link to your post here to avoid too much x-posting with a short description.
Lazarus 2.3, FPC 3.3.1 macOS 12.0.1 x86_64 Xcode 13.1
Lazarus 2.3, FPC 3.3.1 macOS 12.0.1 aarch64 Xcode 13.1
Lazarus 2.3, FPC 3.2.2 FreeBSD 13.0 amd64 VM
Lazarus 2.3, FPC 3.2.2 FreeBSD 12.2 amd64 VM
Lazarus 2.1 r61574 FPC 3.0.4 Ubuntu 20.04 VM
Lazarus 2.0.10 FPC 3.2.0 Win10 VM


TinyPortal © 2005-2018