Recent

Author Topic: Compiling for OSX from Windows  (Read 2822 times)

trev

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1468
  • Former Delphi 1-7, 10.2 user
Re: Compiling for OSX from Windows
« Reply #15 on: September 30, 2020, 04:48:36 am »
You cannot run or compile 32 bit applications on Catalina or later because 32 bit support has (mostly - there are some Carbon bits left) been removed. Mac computers have been 64 bit capable since 2007.

This:

Quote
CarbonBars.pas:

{$IFNDEF cpui386}
{$ERROR only cpu i386 is supported}
{$ENDIF}

suggests that you are trying to compile for 32 bit (i386) instead of 64 bit (x86_64).

Go to Project > Project Options > Compiler Options > Config and Target and setup as follows:

Target OS: Darwin
Target CPU Family: x86_64
Target Processor (Default)
Current LCL widgetset: "Cocoa"

Cocoa is 64 bit; Carbon is 32 bit.
Lazarus 2.1 r65061 FPC 3.3.1 r49223 macOS 10.14.6 Xcode 11.3.1
Lazarus 2.1 r65182 FPC 3.3.1 r49223 macOS 11.4 aarch64 Xcode 12.4
Lazarus 2.1 r61574 FPC 3.3.1 r42318 FreeBSD 12.1 amd64 VMware VM
Lazarus 2.1 r61574 FPC 3.0.4 Ubuntu 20.04 Parallels VM
Lazarus 2.0.10 FPC 3.2.0 Win10 Parallels VM

DonAlfredo

  • Hero Member
  • *****
  • Posts: 1447
Re: Compiling for OSX from Windows
« Reply #16 on: September 30, 2020, 07:12:01 am »
@trev
All correct ! Thanks.

Quote
error: instruction requires: Not 64-bit mode
As stated in a previous post, I have switched back to FPC stable (3.2) due to this error. FPC stable will compile for Darwin i386.

PascalDragon

  • Hero Member
  • *****
  • Posts: 3054
  • Compiler Developer
Re: Compiling for OSX from Windows
« Reply #17 on: September 30, 2020, 09:51:21 am »
oh. What's the difference?

MacOS (more correctly "Mac OS", there never was a "MacOS") = the Classic Mac Operating System developed for the Macintosh family of personal computers by Apple from 1984 to 2001, starting with System 1 and ending with Mac OS 9.

Darwin = the open source BSD UNIX core set of components on which macOS (originally marketed as Mac OS X and then OS X) runs.

Please note that in FPC trunk the Mac OS Classic target has been renamed to MacOSClassic so that in the future we might add a specific MacOS target that would allow for differences between pure Darwin and full MacOS (e.g. user/global settings). This also lead to the introduction of an explicit iOS target, which blocked aarch64-darwin.

Grahame Grieve

  • Full Member
  • ***
  • Posts: 156
Re: Compiling for OSX from Windows
« Reply #18 on: September 30, 2020, 02:46:33 pm »
ok, cocoa vs carbon was my issue - compiling for fine now, great.

Thanks for all the help, really appreciate it.

 

TinyPortal © 2005-2018