Recent

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

trev

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1008
  • 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.
o Lazarus v2.1.0 r63871, FPC v3.3.1 r46876, macOS 10.14.6 (with sup update), Xcode 11.3.1
o Lazarus v2.1.0 r61574, FPC v3.3.1 r42318, FreeBSD 12.1 amd64 (VMware Fusion VM)
o FPC 3.0.4, FreeBSD 12.2-STABLE r365646 amd64
o Lazarus v2.1.0 r61574, FPC v3.0.4, Ubuntu 20.04 (Parallels VM)

DonAlfredo

  • Hero Member
  • *****
  • Posts: 1345
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: 2262
  • 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: 103
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