Recent

Author Topic: Lazarus 4.2 and OSX 10.14 How do you make it build?  (Read 914 times)

fsckit

  • Newbie
  • Posts: 3
Lazarus 4.2 and OSX 10.14 How do you make it build?
« on: September 30, 2025, 04:08:03 pm »
I'm trying to get Lazarus to work on my Mac(specs at bottom of post). I've followed this set of instructions https://wiki.freepascal.org/Installing_Lazarus_on_macOS#Step_2:_Xcode_Command_Line_Tools, tested the compiler with a hello-world program, its ok.

I've installed from binary, and the IDE runs, but it refuses to build anything. These are the messages I get. The project is just the initial blank form. Adding a button and code for the button to show a hello world message box produces this same error.

>    Compile Project, Target: /Users/leon/tmp/project1: Exit code 1, Errors: 4
>    Error: linker: Undefined symbols for architecture x86_64:
>    Error: linker:   "_OBJC_CLASS_$_NSMenuToolbarItem", referenced from:
>    Error: ld: symbol(s) not found for architecture x86_64
>    An error occurred while linking
>    Error: Error while linking


Changing the compiler from /usr/local/bin/fpc to /usr/local/lib/fpc/3.2.2/ppcx64 in the IDE options as suggested on another page doesn't help.

It looks like the linker is broken.  Has anyone any ideas?




My Mac, in case this matters:
Mac Mini 2012
MacOS Mojave 10.14.6
16GB RAM
~500GB SSD with about 80GB free

Lazarus 4.2, FreePascal 3.2.2

I used Delphi a lot in the 90s, but have been away for a while.

wp

  • Hero Member
  • *****
  • Posts: 13323
Re: Lazarus 4.2 and OSX 10.14 How do you make it build?
« Reply #1 on: September 30, 2025, 05:23:20 pm »
My VM with macOS Mojave is broken now, but I remember the same issue. It can be fixed in the following way:
  • Add {$DEFINE DisableCocoaModernForm} to /etc/fpc.cfg
  • Run "make clean bigide" in the Lazarus folder
  • Sometimes there is another compilation error now, at "initIDECocoaConfigForms" in ide/main.pp -- delete this line and run "make bigide" now.

Hansaplast

  • Hero Member
  • *****
  • Posts: 752
  • Tweaking4All.com
    • Tweaking4All
Re: Lazarus 4.2 and OSX 10.14 How do you make it build?
« Reply #2 on: September 30, 2025, 06:06:59 pm »
Just a stab in the dark, but maybe it helps:
You could try using "-WM10.14" in the compiler options.

Go to Project -> Project Options -> Compiler Options -> Custom Options
In the text box "Custom Options" enter this:

Code: Pascal  [Select][+][-]
  1. -WM10.14

Thaddy

  • Hero Member
  • *****
  • Posts: 18666
  • Jungle wars. And failing health it seems.
Re: Lazarus 4.2 and OSX 10.14 How do you make it build?
« Reply #3 on: September 30, 2025, 06:56:33 pm »
Is that an early intel or a late PowerPC? Mac Mini 2012 That is not modern Apple hardware.
The -WM option is probably useless in that case since that is only for Apple M series. That is only for newer Apple hardware.
I can't test it anymore since my older Mac mini (intel) died about two years ago, I only have an M4.

Suggest to install an older version of Lazarus and an FPC to match. (3.0.4 is known by me to work for both Powerpc and intel)

I also wonder how you could install recent xcode? May be possible but unlikely?

I may be wrong: the mini's are just a toy for me and I don't use them frequently.
Otherwise you may be the victim of progress.
« Last Edit: September 30, 2025, 07:04:02 pm by Thaddy »
Due to censorship, I changed this to "Nelly the Elephant". Keeps the message clear.

fsckit

  • Newbie
  • Posts: 3
Re: Lazarus 4.2 and OSX 10.14 How do you make it build?
« Reply #4 on: September 30, 2025, 08:46:24 pm »
Is that an early intel or a late PowerPC? Mac Mini 2012
The 2012 Mac Mini is an intel i5. The last one with upgradable RAM. The last PowerPCs were 2006.

I may be wrong: the mini's are just a toy for me and I don't use them frequently.
Otherwise you may be the victim of progress.

The whole Macintosh line are toys.
Why does the documentation say it works with 10.10 and later?

@Hansaplast
That doesn't seem to have any effect, except that it now compiles the whole thing and leaves us with that same linker error.


@wp

Add {$DEFINE DisableCocoaModernForm} to /etc/fpc.cfg
Run "make clean bigide" in the Lazarus folder

After doing these, and starting Lazarus.app, we get the "Configure Lazarus IDE" window. There is an error in the compiler page:

Error: system.ppu not found. Check your fpc.cfg.

I don't know what system.ppu is or where it should be.

Thanks

dbannon

  • Hero Member
  • *****
  • Posts: 3646
    • tomboy-ng, a rewrite of the classic Tomboy
Re: Lazarus 4.2 and OSX 10.14 How do you make it build?
« Reply #5 on: October 01, 2025, 02:46:31 pm »
I used to build my project on a 2012 Powerbook running Sierra. From memory, I used FPC3.2.2. Thats two releases before Mojave

XCode was not a problem as long as you installed just the XCode command line tools, not the full kit and caboodle.

Davo
Lazarus 3, Linux (and reluctantly Win10/11, OSX Monterey)
My Project - https://github.com/tomboy-notes/tomboy-ng and my github - https://github.com/davidbannon

fsckit

  • Newbie
  • Posts: 3
Re: Lazarus 4.2 and OSX 10.14 How do you make it build?
« Reply #6 on: October 01, 2025, 03:39:28 pm »
@Thaddy

Reducing down to 3.8 works! It seems 4.2 isn't compatible.

Thanks guys

wp

  • Hero Member
  • *****
  • Posts: 13323
Re: Lazarus 4.2 and OSX 10.14 How do you make it build?
« Reply #7 on: October 01, 2025, 04:22:19 pm »
@wp

Add {$DEFINE DisableCocoaModernForm} to /etc/fpc.cfg
Run "make clean bigide" in the Lazarus folder

After doing these, and starting Lazarus.app, we get the "Configure Lazarus IDE" window. There is an error in the compiler page:

Error: system.ppu not found. Check your fpc.cfg.
Maybe I should note that my Lazarus is in the Documents folder to give me full file permissions.

 

TinyPortal © 2005-2018