Difference between revisions of "Lazarus Can't find unit system used by fcllaz"

From Free Pascal wiki
Jump to navigationJump to search
Line 21: Line 21:
 
If the file doesn't exist, then from a command window in the .../fpc/bin directory execute: fpcmkcfg.  By default it prints out a default fpc.cfg file. The portion that needs focus to address the problem is found in the first half of the listing. Copy the listing to an editor to make changes. The areas we need to focus on is:
 
If the file doesn't exist, then from a command window in the .../fpc/bin directory execute: fpcmkcfg.  By default it prints out a default fpc.cfg file. The portion that needs focus to address the problem is found in the first half of the listing. Copy the listing to an editor to make changes. The areas we need to focus on is:
  
[file:]
+
[[file:fpcmkcfg1.png]]

Revision as of 01:56, 29 June 2016

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. Windows installations are typically found in C:\lazarus\fpc\<version number>\<cpu>-<operating-system> You may find an old version exists which could be the cause of the error message or you may find that the files simply don't exist. The first thing to do is to find out what your situation is by looking.

If the file doesn't exist, then from a command window in the .../fpc/bin directory execute: fpcmkcfg. By default it prints out a default fpc.cfg file. The portion that needs focus to address the problem is found in the first half of the listing. Copy the listing to an editor to make changes. The areas we need to focus on is:

fpcmkcfg1.png