These instructions are for installing Lazarus cross-compilers for Android, Linux and Windows for i386, ARM and x86_64 processors in Ubuntu Linux 64-bit.
Now if you have installed Lazarus and FPC from official Ubuntu repository - better remove it, because it is not compatible with these instructions.
Install Lazarus and FPC 64-bit from here:
Lazarus Download
I was using Lazarus Linux amd64 DEB (64-bit)
Installation instructions:
sudo dpkg -i fpc_3.0.0-151205_amd64.deb #installing Free Pascal compiler sudo dpkg -i fpc-src_3.0.0-151205_amd64.deb #Installing Free Pascal source files sudo dpkg -i lazarus_1.6-0_amd64.deb #Installing Lazarus it most likely will end with errors because of missing dependencies, but do not worry sudo apt-mark hold fpc fpc-src lazarus sudo apt-get install -f #Fix broken dependencies if they were encountered during installation
"sudo apt-mark" puts package on hold so that it will not automatically update. In case of Lazarus there are official Ubuntu packages available in repository which can break the installation.
After this you should have working Lazarus.
If you want to compile to ARM or i386 processors from 64-bit Ubuntu - you need cross-compilers. One of the options is to build them yourself following these official instructions of cross compiling or you can install cross-compilers which I have already built.
Free Pascal cross-compilers:
* i386(32-bit)
* ARM
Remember - you already have a 64-bit Free Pascal compiler, if you have followed my instructions.
It is not enough to have a working cross-compilation compiler - you also need a pre-compiled FPC source. You can get it at the same place following official instructions, or you can install my pre-compiled FPC source.
Free Pascal cross-compiled source:
* i386-win32(Windows 32-bit)
* x86_64-win64(Windows 64-bit)
* i386-linux(Linux 32-bit)
* arm-linux(Linux ARM)
* arm-android(Android ARM)
Remember if you have followed my instructions you already have a Linux 64-bit source.
To start cross-compilation you must select the right values in fields "Target OS" and "Target CPU family" in Project->Options->Compiler Options->Config and Target.
In case of Android you must select "customdrawn" as your widget set or you will fail to compile the project.