0

If I try to compile a simple program by fp that is a Free Pascal integrated development environment installed along with fpc package, I get error "Fatal: Can't find unit system".. I can compile the program by fpc command line compiler, but "The IDE has an internal compiler."

I also wonder, if I have to add help files one by one in Help > Files... by browsing to the source directory where I extracted them in each time I run fp in a new directory?

jarno
  • 5,317
  • 5
  • 49
  • 77

2 Answers2

1
  • How to use Free Pascal (Lazarus) on Linux (Ubuntu) - no install solution:
  1. If not already installed, install "GNU binutils" (sudo apt-get install binutils)

  2. Dowload the latest version of Free Pascal (Lazarus) .deb package ("fpc-laz_ ... .deb") from the Downloads section of the Lazarus Home page (Lazarus is a professional open-source cross platform IDE powered by Free Pascal):

  3. Place the downloaded .deb package in the folder where you are going to extract it

  4. Extract the downloaded .deb package by Right-Click-ing it and then choosing Extract Here:

  5. Rename the extracted folder, as you desire, for example "fpc"; Further we denote the extracted folder as "<BASEPATH>"

  6. Open the extracted folder and then, extract "data.tar.xz" - as "data" folder

  7. Launch the Free Pascal window by typing the next command in the terminal (this command may vary according to the terminal used - in this case (Ubuntu) it is used gnome-terminal):

    gnome-terminal -e '<BASEPATH>/data/usr/bin/fp'

    OR:

    gnome-terminal -- '<BASEPATH>/data/usr/bin/fp'

  8. To add units folders: From the Free Pascal Menu, access: Options -> Directories -> and drag and drop to the "Units" tab, the next three lines, line by line (each on a new line):

    <BASEPATH>/data/usr/lib/fpc/$fpcversion\units\$fpctarget

    <BASEPATH>/data/usr/lib/fpc/$fpcversion\units\$fpctarget\*

    <BASEPATH>/data/usr/lib/fpc/$fpcversion\units\$fpctarget\rtl

    Please note that by moving the files from the <BASEPATH> directory to other "<BASEPATH>", you'll have to update the above three lines so that they contain the new <BASEPATH>, otherwise you might get errors like:

    "Fatal: Can't find unit ..."

  9. For Official Installation and Online Documentation see:

    Installation

    Online Documentation

  • Regarding adding help files one by one using: Help -> Files -> New:

    • if the help files are located in a folder that is not moved - for example outside the <BASEPATH> directory - you won't have to readd the help files;

    • also adding the help files could be done by editing the [Help] section ("Files=...") in the fp.ini file used by the fp binary

  • Thanks. You can also install the version available in _universe_ repository, which might be older. – jarno Oct 12 '20 at 12:49
0

I've solved, following this article: https://sebcosta.altervista.org/joomla/articles/37-free-pascal.html (great tutorial from Sebastien Costa!).

My Free Pascal is installed dowloading a .deb file from https://community.linuxmint.com/software/view/fp-ide on a Linux Mint 19.2 version (tina).