Author Topic: Macbook M1 with Lazarus up and running but cannot build app  (Read 2127 times)


  • Newbie
  • Posts: 1
Macbook M1 with Lazarus up and running but cannot build app
« on: February 17, 2021, 03:30:38 am »

I am very new to Lazarus (although I used Delphi from 1995 to 2008) and I am trying to run it in my Macbook with M1 CPU.

I managed to compile the native FPC for Apple Arm, and also was able to build Lazarus using the laz_fixes branch (grabbed via git). When I run Lazarus, everything seems fine, however, when I try to run an empty application I get the error:

Compile package LCL 2.0.11: Exit code 1, Errors: 2
cocoautils.pas(128,23) Error: No matching implementation for interface method "hasMarkedText:Boolean;" found
cocoautils.pas(134,13) Error: Objective-C messages require their Objective-C selector name to be specified using the "message" directive.

I've searched here and the "Internets" but the very few references to this error are old (2+ years) and with no clear instructions/solutions to follow. Maybe I am missing the obvious but does anyone know what could that be?

My versions:
Free Pascal Compiler version 3.3.1 [2021/02/16] for aarch64
The laz_fix branch was updated today (Feb 16)




  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1683
  • Former Delphi 1-7, 10.2 user
Re: Macbook M1 with Lazarus up and running but cannot build app
« Reply #1 on: February 17, 2021, 05:44:52 am »
I've not tried Lazarus fixes, bit I just built Lazarus trunk successfully on an M1 Mac mini and it seems to happily compile applications as well as an empty project.

Note: due to what I'm assuming is a recently introduced bug, if you build the IDE with the bigide option it fails when attempting to link lhelp because of a missing Xorg library (there being no Xorg installed in Big Sur or  indeed several previous macOS versions). Just omit bigide from the build arguments and it will build successfully. You can install any of the bigide packages from the Online Package Manager, maybe even lhelp but I have not tried as I don't use it.
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