This problem has come to bite me again. It has been around for too many years, far too long, and by now there should be clear cut method for the end user to diagnose it and fix it. The trial and error method is simply unprofessional, if that is the appropriate term to use.
I need to ask some questions about the whole process.
1. Is there a clear cut relationship between the location of the fpc executable used by Lazarus, the contents of the fpc.cfg and the location of the system.ppu that should allow the setting of the contents of the fpc.cfg?
2. If the wrong system.ppu is being used, does it mean that system.ppu of the fpc used by Lazarus is not the one which compiled the trouble package or what, ie does the fpc know which system.ppu it needs, ie is its own correct system.ppu placed at a fixed location relative to its own path, or does it get it from the fpc.cfg?
3. If on opening Lazarus, Lazarus agrees that the fpc is right, and that it is the same fpc which was used to compile it, and the system.ppu is located at a fixed location relative to the fpc itself, and that can be added to the fpc.cfg, then why is this problem so hard to fix?
4. Can the actual fpc version, as well as the location where it is stored at the time of the compilation be stored in the fpc executable, as well as in the Lazarus executeable, so that if you compile Lazarus and fpc yourself you know what system.ppu is involved?
5. Is there some verbose setting which can output wwhat directories are being searched, as well as indicate the directories where the correct system.ppu and other critical files were expected to be in case they were not?
6. Is there an fpc build script that does the same thing as the IDE, which can be run from the command line with enough verbose settings to check the problem?
Your sincerely,
Frustrated Frank