Results 1 to 3 of 3

Thread: Lazarus for Raspberry Pi 4

  1. #1

    Lazarus for Raspberry Pi 4

    Write once - compile anywhere the Lazarus motto. Nice when it works but there always seem to be some tinkering to do.

    Currently I mostly program on Windows/Linux using the Lazarus 2.2.0 version. Porting to Debian Linux is a fairly simple process for my type of games but the Raspberry Pi is a somewhat tougher nut to crack.

    First problem is to install Lazarus at all. There are some descriptions available out there, no doubt useful for those who know their Pi OS well but I'm a Pi noob and tend to run into problems.

    Eventually I found a solutions that seems to work reasonably.

    That is choosing the 32 bit Pi OS for the Raspberry and installing Lazarus with the help of

    That currently gives the Lazaurs version 2.0.0 from 2019. Good enough but directly importing a project from Windows (2.2.0) doesn't work in my system.

    A workaround is to check the

    Maximize Compability of Project Files

    in Project Options > Miscellaneous.

    That seems to make the project compile for Raspberry. There is still the complaint of crtbegin.o not found but the program seems to run well anyway..

    Why did I go for 32-bit Pi OS when there is a 64-bit OS available?
    For compatibility reasons. On the hope that also some of the older 32-bit Pi systems can run my software.

    Unfortunately I couldn't compile the two latest projects (PONX and MaxDe) for Raspberry but the older Grayout program seems to run well.

    As far as possible the plan is to create new software/games for both Linux/PC and for Raspberry. The Raspberry is a weaker computer but so far my programs are lightweight enough to run even on a Pi. At least the Pi 4.

    New project is ongoing but there is not much to show yet. Gameplay will again be very simple but there will be somewhat more action this time. The name is not yet dececided. I can mention the size will be 1024*544 pixels. Hopefully that will make it fit into most monitors.
    Last edited by Jonax; 20-09-2022 at 03:19 PM. Reason: typo

  2. #2
    To install Lazarus (and FPC -- the underlying compiler) on Raspberry Pi in a simplest way, I would recommend to just install packages fpc and lazarus-ide on Raspberry Pi.

    From command-line, as root:

    apt install fpc lazarus-ide
    Or use package manager (like Synaptic) to install these packages with a GUI. As of Raspbian 11 (based on Debian bullseye), this gives FPC 3.2.0 and Lazarus 2.0.10. Not the very latest FPC/Lazarus versions, but workable, and the installation process is easiest possible. And they will get updated with new Raspbian

    Alternative 1: I would say the next-best alternative is to use fpcupdeluxe, . Get it from , for 32-bit Raspberry Pi you want fpcupdeluxe-arm-linux. It allows to install various FPC/Lazarus versions, it will give you the latest FPC and Lazarus (3.2.2 and 2.2.2) without much effort. You may still want to do "apt install fpc" before using fpcupdeluxe -- this way fpcupdeluxe will have a starting compiler to bootstrap the latest FPC version.

    Alternative 2: If you feel comfortable with shell, you may want to try a script like my . But admittedly this requires to understand a bit what's going on under the hood, it's a useful script for me (it's like "fpcupdeluxe but really really minimal, just do minimum steps to automatically install FPC/Lazarus from GitLab").

    Shameless self-plug:

    If you're doing games on Raspberry Pi, you may also want to take a look at my Castle Game Engine, . We have recently released a big update with version 7.0-alpha.2. The engine features a comfortable visual editor and can be used with FPC (using Lazarus is optional; you need FPC + any text editor capable of editing Pascal files).

    And we support Raspberry Pi, since a long time, because I love Raspberry Pi It's an amazing device, fully functional computer with amazing price and size. See my initial excited news about Raspberry Pi from 2019 and 2020. Our download page contains ready downloads for Raspberry Pi (32-bit -- just because that seems to be the default, for now, used by most people; I see it is also what you chose). All our releases are automatically done (by Jenkins) also for Raspberry Pi, the download linked above will give you a working game engine for Raspberry Pi with all the latest features described in "7.0-alpha.2" release notes

    If this sparks an interest and you have any questions about Castle Game Engine, let me know!

  3. #3
    Thanks for suggestions and tips.

    While searching for solutions I really did stumble upon both the fpcupdeluxe and the apt install method. Fpcupdeluxe sure got a lot of praise and is no doubt useful but I never managed to make it work. Probably because I'm Pi noob. The apt install worked somewhat better but there was some issue on my system., can't remember which one. Might have used some variation of the command, from some forum.

    Anyway after reading various forums it seems I am not the only one experiencing difficulties with Lazarus on Pi. So I'm just describing how I tackled the situation. Maybe that can help some other clueless programer out there, if they run into problems with fpcupdeluxe. Not the best possible solution but the best I can do at the moment. As you wrote: workable. That will have to do for me for now.

    I totally agree on your praise for the Raspberry Pi. Indeed an amazing little device. The very modest power use is helpful too.

    I'm glad to see you too chose the 32-bit.. Seems to be the right choice for now.

    The Castle Game Engine seems impressive. Well done! I have of course stumbled upon it in various forums, but never tried it, I'm afraid. So little time and so much to do...


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts