Lazarus Can't find unit system used by fcllaz

From Free Pascal wiki
Revision as of 21:19, 28 June 2016 by Abtaylr (talk | contribs)
Jump to navigationJump to search

You typically see this error message following a fresh install or when trying to build FreePascal and Lazarus from source code. The error means literally that the pre-compiled units of FreePascal for one reason or another are simply not being found by the compiler. There are generally 2 sources for these errors -- left over remnants from old install and environment problems.


Program Placement

There are currently at least 2 views of where FreePascal and Lazarus are to be installed on Linux, Unix and similar systems. The first is a more security conscious thought pattern where the executables are placed in either /root/bin or /usr/bin, libraries are placed in /root/lib or /usr/lib, shared files are placed in /usr/share, and configuration files in /home/username. The other favors control by the user by placing executables in /home/username/FreePascal, libraries and pre-compiled units in /home/username/FreePascal/lib/fpc/version-number/units and configuration files in /home/username. The word 'username' is typically the users name or handle. FreePascal could be a higher directory with lower directories for fpc-3.0.0 and lazarus. I follow this latter paradigm keeping all of my FreePascal/Lazarus files in one convenient location.

With Windows the same thing can happen where multiple files exist in C:\Program Files\, C:\Program Files(x86)\, C:\lazarus or another custom directory. If a user is trying to run multiple installations of different versions there are other wiki pages addressing that problem.


Finding Dangling Files

If you have had previous installations of FreePascal or Lazarus, a subsequent installation may place the new files in a different location, e.g. instead of /usr/local/bin using /usr/bin. The result is that you may have an existing configuration that is causing confusion. If you only plan on having a single installation, then your path is clear -- either remove all of the files and start over or remove all of the files not from the current installation. I find that if you are unclear, then start over. One thing that can help is to examine the dates of the files. The newer ones go with the current installation.


Environment Files

FreePascal typically uses a file called fpc.cfg and another fppkg file called default. These files are usually found in /home/username/.fpc.cfg and /home/username/.fppkg/config/default.