Free Pascal For Mac

This article applies to macOS only.

See also: Multiplatform Programming Guide

See the download page for more information (the method changes with almost every new Xcode and/or Mac OS X release, so the information in this readme is usually out of date). There are two methods to install Free Pascal for Mac OS X. 1) Download and install the Mac OS X installer package 2) Install fpc using fink This second method additionally.

  • Solutions: (1) Check that you have the current Xcode (optional - see here) and Xcode command line tools package (mandatory) installed; (2) Lazarus Menu Tools Configure Build Lazarus - Find and check 'Clean all' and then Build. If that doesn't work, I'd be tempted to delete both FPC + Lazarus and start again.
  • Pascal free download. Free Pascal Compiler A 32/64/16-bit Pascal compiler for Win32/64/CE, Linux, Mac OS X/iOS, Android, FreeBSD, OS/2, Game Bo.
  • Turbo Pascal,the world-standard Pascal compiler, adds Object-Oriented Programming. Combining the Simplicity of Apple's Object Pascal language with The Power and efficiency of C to create Turbo Pascal,the object-oriented programming language for the rest of us.
  • Free Pascal is a professional 32 and 64-bit Pascal compiler. It is multiplatform and open source that integrates with Xcode and is available for various processor architectures, among them: Intel x86, Amd64/x8664, PowerPC, and PowerPC64. Free Pascal includes three templates to work with Apple's development suite: FPC Carbon Application, FPC-C.

English (en)

This page lists solutions to the most frequent problems that may arise during (and after) installation of Lazarus and Free Pascal on macOS. Please read Installing Lazarus on macOS first and pay special attention to the sections that apply to your versions of macOS, Xcode, Lazarus and Free Pascal.

Lazarus doesn't run project

After moving to macOS or after upgrading to a new version of macOS Lazarus is unable to compile and run a project.

Solution: Most likely, this behaviour results from missing command line tools. In newer versions of Xcode they are no longer installed by default. You can install them by running

from the terminal. See also Installing Lazarus on macOS for more details.

Compilation aborts with weird messages

I have correctly installed Lazarus and FPC, but compiling a simple demo program stops with the Free Pascal exit code 256 and the message 'Lazarus Panic /bin/sh: clang: command not found'.

Solution: This behaviour may arise from a too old Xcode version installed. Generally, you should use the newest Xcode version that is available for your operating system. Lazarus 1.6 requires, e.g., Xcode 3.2.6, or newer. With Xcode 4.3 or newer, you should also install the Xcode command line tools as described above or in the article Installing Lazarus on macOS.

ld: symbol(s) not found for architecture i386

I am trying to compile a blank project on Catalina immediately after installing FPC and Lazarus but I get this error 'ld: symbol(s) not found for architecture i386'.

Solution: Go to Lazarus > Tools > Options, if your compiler may be set to ppc386 (32 bit), then change it to ppcx64 (64 bit) or fpc (a wrapper that should choose the correct compiler). There is no 32 bit support in Catalina. In the trunk version of Lazarus, the Lazarus > Tools > Options menu has been moved to the Lazarus > Preferences menu

Debugger not found

I have installed the latest version of Lazarus on a new Mac. My program is built fine, but when I try to run it I get a message that the debugger /usr/bin/gdb doesn't exist or isn't runnable.

Solution: Since version 5, Xcode does not include the GDB debugger but the LLDB debugger. For recent versions of macOS, go to the Tools > Options | Debugger menu and choose 'LLDB debugger (with fpDebug) (Beta)' and set the executable to /usr/bin/lldb.

Solution (legacy): Xcode v5 no longer includes the GDB debugger. See GDB on OS X Mavericks or newer and Xcode 5 or newer for possible solutions unless you are running a recent version of macOS (in which case, see above).

Form not shown after moving to Mac

My application works well on Windows and Linux, but after changing to Mac my forms are invisible. I tried to re-scan the FPC source directory, and I clicked 'Create Bundle', but this didn't solve the problem. Unlike my app, a very simple demo application works well.

Solution: This may result from a wrong position setting of your form(s). Your Windows machine may have a multi-monitor setup, so that the forms are outside the visible area of a single-monitor environment, i.e. if your Mac has only one monitor. You should check and correct the top and left properties of your forms in the object inspector. (Of course, this also applies in the other direction, i.e. if you have a multi-monitor Mac and a single-monitor Windows or Linux machine).

Form not responding to mouse clicks

After starting the program the form is visible, but not responding to interaction via the user interface.

Solution: Programs for macOS-based systems are more complex than programs for Windows or Linux. They require the existence of an application bundle, a special opaque directory structure, which determines the modalities of interaction with the operating system and the GUI. You may create an application bundle in the project settings or alternatively via shell commands. Make sure that the option Use Application Bundle for running and debugging (for Darwin) is checked.

fpcsrc not present

Free Pascal For Mac

After installing and first running Lazarus, the welcome window complains that the directory '/usr/local/share/fpcsrc' is not found.

Solution: You have to install fpcsrc. This is a Lazarus-specific installer package that comes with your distribution of Lazarus. If you have downloaded Lazarus from SourceForge you find fpcsrc in the same server directory as the Lazarus package.

Multiple error messages after upgrading Lazarus and/or FPC

After upgrading Lazarus and/or Free Pascal to a new major version, trying to compile my code results in multiple error messages.

Solution: This behaviour may have multiple reasons. After every major upgrade you should rescan the FPC source directory. If this doesn't help it may be useful to delete the file fpcdefines.xml (it is within the ~/.lazarus folder). Additionally, you should check your code for incompatibilities that may result from changes in the compiler (although this is quite rare with code that is not too unusual). See Category:FPC User Changes by release for intentional changes to the compiler that may break existing code.

Unit XY not found

I have freshly installed a new version of Lazarus on my machine. Trying to compile an application results in the error message 'Error: unit not found: XY'. (XY is a place holder for any unit name.)

Solution: Try to re-scan your FPC source directory via the Tools... menu of the IDE.

Fatal: Cannot find [...] used by [...], incompatible ppu=[filename], package [package name]

When the compiler gives the message 'Cannot find A used by B', Lazarus checks what pas/pp/ppu files are in the search path, and if there is a ppu file it inserts 'incompatible ppu=filename, package'.

Explanation: FPC cannot use this ppu for one of these reasons:

  • it was compiled with another FPC version;
  • it was compiled with (depends on) some other ppu files that are not in the search path;
  • you misconfigured some search path(s).

Solutions: (1) Check that you have the current Xcode (optional - see here) and Xcode command line tools package (mandatory) installed; (2) Lazarus > Menu > Tools > Configure Build Lazarus - Find and check 'Clean all' and then Build. If that doesn't work, I'd be tempted to delete both FPC + Lazarus and start again. See Uninstalling Lazarus and Free Pascal.

Error: User defined: only cpu i386 is supported

When compiling Lazarus on macOS I receive this error: carbonbars.pp(16,2) Error: User defined: only cpu i386 is supported

Solution:

Error: ld: framework not found Cocoa

When compiling Lazarus on macOS I receive this error: Error: ld: framework not found Cocoa

Solution: You forgot to install the Xcode command line tools or they've since been deleted. See Installing Xcode Command Line Tools to resolve. You may also need to re-install FPC _after_ installing the Xcode command line tools so that it can find the macOS frameworks.

Error ppc1 not found

When compiling the Free Pascal Compiler on macOS I receive this error:

Solution: GNU Make does not handle directory names with spaces in them. Rename 'fpc trunk' to 'fpc_trunk' or similar and it should work without this error.

Error: library (X11 or Truetype) not found

If you are compiling X11 applications (typically using fpGui) FPC needs to know where to find the libX11.dylib and libfreetype.dylib libraries. If FPC cannot find these libraries, you will receive a library not found error during linking.

Solution: Depending on your version of macOS or XQuartz these may be found in /usr/X11/lib or /opt/X11/lib with a symlink from /usr. The best solution to this is probably to edit /etc/fpc.cfg and add the line '-Fu/usr/X11/lib'

Application does not accept keyboard input

After compiling my application, I cannot enter anything in the edit boxes and the application will not accept any keyboard input.

Solution: You forgot to create an application bundle. Lazarus > Project > Project Options > Application - Create Application Bundle.

Warning arm64 function not 4-byte aligned

When compiling on an Apple Silicon M1 processor, I get a 'warning arm64 function not 4-byte aligned' for every function.

Free Pascals New Version Download

Solution: That's probably a consequence of using -Os. That setting unconditionally sets procalign (jump align) to 1. That's definitely wrong for AArch64 and a bunch of other architectures. There is no 'minimum required alignment' for these settings defined yet anywhere in the compiler, so that will need to be added. In the meantime, do not use -Os to optimize size.

Resource compiler 'fpcres' not found

When compiling an application after installing or compiling a new Lazarus version, it fails with the error 'Error (9021) Resource compiler 'fpcres' not found, switching to external mode'

Solution: Create a file called .fpc.cfg (note the leading dot in the filename) in your home directory and add the lines:

If the file already exists it should contain the first of the lines above, so just add the second line.

Other questions

I didn't find my issue here.

Solution: You might find a possible solution at the Lazarus and Free Pascal Forum. Otherwise, you might ask your question there.

See also

Retrieved from 'https://wiki.freepascal.org/index.php?title=Mac_Installation_FAQ&oldid=146117'

Borland Turbo Pascal is a Pascal programming language compiler with an Integrated Development Environment targeted at the hobbyist and entry-level market. There were versions for CP/M and DOS. For a time, it was sold along side their professional 'Borland Pascal' product line. Borland also produced a set of 'toolbox' libraries along side their earlier versions. Turbo pascal mac, LuckyWire 1.0.0.0, LimeWire Turbo 5.8.3, Free Pascal 2.4.4. Turbo Pascal was the language to know years ago. Today, it is used as a teaching language. Windows Vista – 10, Mac OS X and Linux computers can run Turbo Pascal with DOSBox. Users looking for a free Pascal IDE and compiler that is modern and works for Windows, Mac OS X, Linux naively should take a look at Free Pascal Compiler with Lazarus.

This version The latest release version is 3.2.0

Free pascal download windows 10

'Unknown developer' error when installing (Mac OS X 10.7 and later)

If you get the message that the FPC installer was created by an unknown developer and cannot be opened, right-click (or ctrl-click) on the installation package and choose 'Open' in the contextual menu. If this does not work, you may first have to go to 'System Preferences' -> 'Security & Privacy' -> 'General', and 'Allow apps downloaded from: Mac App Store and Identified developers'. These workarounds are required because we do not pay Apple 99 euro per year, which would prove you can trust us.

Xcode 11+ compatibility (macOS 10.15 Catalina and later)

FPC 3.2.0 is qualified for use with Mac OS X 10.4 till macOS 10.15. Xcode 11+ no longer includes support for compiling Intel 32 bit programs. If you wish to compile such programs, you will have to copy an older Mac OS X SDK from a previous Xcode installation and point the compiler to it with the -XR command line parameter.

Xcode 10+ compatibility (macOS 10.14 Mojave and later)

FPC 3.2.0 is qualified for use with Mac OS X 10.4 till macOS 10.15. Xcode 10+ installs some command line file in different locations compared to previous releases. If you already installed FPC under a previous Mac OS X/OS X/macOS version, you will have to reinstall FPC 3.2.0 under macOS 10.14 to get a configuration file that enables the compiler to find the necessary files). See also the section below on how to install the command line tools.

Xcode 5+ compatibility (OS X 10.9 and later; for OS X 10.8, see below)

FPC 3.2.0 is qualified for use with Mac OS X 10.4 till macOS 10.15. Xcode 5 and later however no longer install the command line tools by default, which are required by FPC. To install them manually, open '/Applications/Utilities/Terminal', execute xcode-select --install and choose 'Install'. Afterwards, FPC will function correctly.

Xcode 4.3-5.x compatibility (Mac OS X 10.7/OS X 10.8)

Turbo Pascal Download Windows 10

FPC 3.2.0 is qualified for use with Mac OS X 10.4 till macOS 10.15. Xcode 4.3 and later however no longer install the command line tools by default, which are required by FPC. To install them manually, open Xcode, go to Preferences, select 'Downloads;' and install the 'Command Line Tools'. Afterwards, FPC will install and function correctly.

Xcode 3.2.x-4.2 compatibility (Mac OS X 10.6)

FPC 3.2.0 is qualified for use with Mac OS X 10.4 till macOS 10.15. There is however an issue when compiling dynamic libraries with FPC under Mac OS X 10.6 due to a bug in the Xcode 3.2.x linker. This bug has been fixed in Xcode 4. You can work around the bug in Xcode 3.2.x by using the -k-no_order_inits command line parameter when compiling a dynamic library.

Download the 3.2.0 release in 1 big file:

  • fpc-3.2.0.intel-macosx.dmg (162 MB)contains an installation package for compiling Intel (32 bit and 64 bit) programs (updated to install successfully on macOS 10.14 'Mojave').
  • fpc-3.2.0.intel-macosx.cross.powerpc-macosx.dmg (125 MB)contains an add-on installation package for compiling PowerPC (32 and 64 bit) programs.
  • fpc-3.2.0.intel-macosx.cross.ios.dmg (178 MB)contains an installation package for compiling iPhone/iPod Touch/iPad programs. For Xcode templates, see Phil Hess' site.
  • fpc-3.0.5.intel-macosx.cross.ios.dmg (66 MB)contains an installation package for compiling iPhone/iPod Touch/iPad programs. For Xcode templates, see Phil Hess' site.
  • fpc-3.2.0.intel-macosx.cross.jvm.dmg (12 MB)contains an add-on installation package for compiling JVM programs.

Back to mirror list
Back to general download page

Free Pascal Download Windows 10

Free Pascal adalah pengompilasi 32 dan 64 bit untuk berbagai arsitektur sistem operasi dan proses, ditujukan untuk model seperti Intel x86, AMD64/x86_64, PowerPC atau Sparc.
Free Pascal kompatibel dengan bahasa yang mendukung Borland Turbo Pascal 7.0 dan Delphi 7, meskipun tidak ada pengembangan yang lebih baik di sini.
Antarmuka Free Pascal adalah sama seperti sebelumnya, dalam modus teks, dan juga sama seperti yang digunakan untuk Turbo Pascal dan Borland.
Karakteristik lain dari Free Pascal yaitu: proses overhead, pemuatan variabel dalam register, pengoptimal kode, perakit data analisis tingkat aliran, properti global, dll.