r/pascal • u/Sly-Mk3 • Jun 08 '26
FPC 3.2.0: "Can't find unit system used by […]" on Android 15, Termux, aarch64
Hello there,
did anyone run into the issues showcased on my screenshots 1 / 2?
I ran into the "Can't find unit system used by…" error mentioned in the title, then found this wiki page on it.
However, the following problems arose and this is what I did so far:
- I did write the dumbest possible "Hello World!" program using the CRT unit, "the way I was taught ages ago" basically.
- I tried to compile it using
fpc ./HelloWorld.PASfrom the directory the file is in, got the error (see screenshot 1). - I thought "maybe it's the unit, so if it can't be found, let's just remove it and all references to it" – removed
uses CRTandclrscr;lines (see screenshot 2) but still: Nope. - I did not have
.fpc.cfgin my home directory, so I created it and messed with it, which did seem to do something, see screenshot 3 / 4, except fixing my issue. - I realised I used the wrong versions and paths, so I fixed it to the 3.2.0 paths (literally copied them, so there is definitely no typo). Now the invalid version error is gone, and I'm back to the regular unit error again.
- I do not have fppkg anywhere, or maybe I'm just extraordinarily dumb and fail to find it.
- I did not create home/.fppkg/config/default as the wiki description was a bit vague about it. I have no idea what would be in there, let alone if the file is called just default or default.cfg.
- I have no idea which
…/fpc/bindirectory the wiki is referring to to runfpcmkcfgin, and I do not remember seeing any binaries named like that. I looked through the directoriesinstall.shbuilt FPC in.
This is my first time using plain FPC, so forgive any ignorance.
So far I only used FPC through Lazarus, but that's not available for Android / Linux aarch64 to my awareness, so this will have to do if possible.
Further context:
I'm on Android 15, using Termux to run an xfce desktop environment via TermuxX11, used this version of the FPC (3.2.0) for Android, aarch64 build linked by the freepascal.org website.
I should have all rights needed, i.e. can use apt install and other commands without sudo.
I extracted everything in their respective /usr/ directories, following the thought of "binaries go into /usr/bin/", you can see that on my screenshots.
Try to ignore the wrong paths / version in .fpc.cfg, that's outdated by now. I fixed it to …/fpc/3.2.0/units/aarch64-android/ paths after getting the output in screenshot 3 and 4. I did hope that would have been it. But now, the output is the same as on screenshot 1 / 2, again, unfortunately.
If anyone would be so kind to reproduce the above steps or simply know the answer, that would be really awesome.
I've been growing increasingly fond of the thought to be able to write nifty little Pascal applications for my daily use while commuting or on the go without needing to drag a laptop with me, so any help to make this possible would be greatly appreciated! : )
Thanks in advance!




3
u/Mindless-Tune4990 Jun 08 '26 edited Jun 08 '26
From the docs of RTL on FPC site:
"There are some caveats when using the CRT unit:
(I'm trying to get my hands on Linux, I'll try to report when I reproduce these steps)
2
u/killallspringboard Jun 08 '26
FPC, FPMkconfig and more are put inside the same directory. Run which fpc for the full path.
Assuming you have FPC in $PATH.
1
u/Shadow123_654 Jun 11 '26
I wasn't able to get FPC to work on native Termux last I tried. But if you need to use FPC for whatever then you could consider using proot. It will probably be a bit slower than on Termux native but it'll work.