[SOLVED] Can't find unit contnrs used by masks lazarus / 1-Linux ---------------------------------------------------------------------- HappyLarry · 2012-03-02 18:47 I have tried to install a new version of Lazarus on Ubuntu. I installed it from comatible .deb files (Lazarus 0.9.30 and Free Pascal 2.4.2 I removed all trace of the previous versions of Free Pascal and Lazarus before I started. When I compile and run  a new project, I get the error: QuoteCan't find unit contnrs used by masksI have searched the Internet and this seems to be quite a common problem - unfortunately I couldn't find an answer. Any ideas? ---------------------------------------------------------------------- marcov · 2012-03-03 01:21 http://www.stack.nl/~marcov/buildfaq/#toc-Subsection-2.6.2 ---------------------------------------------------------------------- HappyLarry · 2012-03-03 13:28 Thanks marcov The link says Quote2.6.2 CONTNRS or other FCL-BASE units not found ↓ If the compiler can’t find contnrs, this points to a problem with the -Fu paths. It probably means -Fu was wrong, but the makefiles managed to auto-add the RTL, and the contnrs (and other FCL-BASE) unit(s) are then the first unit that can’t be found. It can also point to duplicate .ppu files or mixing of FPC versions. I don't understand this. 1. A problem with -Fu paths - I simply installed the .deb files from SourceForge. 2. Duplicate .ppu files -  I assume the new installation replaces any old files. 3. Mixing of fpc versions - I have had fpc 2.4.4 installed before and I was switching to fpc 2.4.2 because that is the correct match for Lazarus 0.9.30. However I had completely uninstalled (Package/Mark for complete removal in Synaptic) anything to do with fpc. ---------------------------------------------------------------------- Chronos · 2012-03-03 22:03 This is pretty common problem especially on linux where installation or upgrade is even much complicated than on windows where you can simply install all-in-one lazarus package. Detailed information is covered by http://wiki.freepascal.org/Unit_not_found_-_How_to_find_units Today I tried to upgrade fpc from 2.4.4 to 2.6.0 on Xubuntu and faced same problem. But in my case it was mess with multiple installations of 2.6.0. Installation using debs from lazarus snapshot page works but installation using FPC installation (which use different directory layout) create another configuration in /home/user/.fpc.cfg which have higher priority over /etc/fpc.cfg. And this config file use different paths to deleted fpc installation. So in my case problem with "Can't find unit contnrs used by masks" was solved by deletion(rename) of /home/user/.fpc.cfg. Check content of fpc.cfg if there are correct paths such /usr/lib/fpc/$fpcversion/ Of course that FPC should show much better error message and direct user straight to solve problem. For now we should suffice with generic message such "Error occurred. Find it by yourself, fix it and than come back and try again. Maybe this time it will be your lucky day." ---------------------------------------------------------------------- HappyLarry · 2012-03-05 19:48 Good one Chronos!    Well, today was my lucky day. I looked for fpc.cfg and couldn't find it. According to man fpc.cfg Quote        The compiler looks for the fpc.cfg file in the following places :             - Under Linux and unix                  - The current directory.                  - Home directory, looks for .fpc.cfg                  - The directory specified in the environment                       variable PPC_CONFIG_PATH, and if it's not                       set under compilerdir/../etc.                  - If it is not yet found: in /etc. I don't know where compilerdir/../etc.is, but I looked everywhere else. Nothing.  Luckily  I had a working version of Lazarus 0.9.30 + fpc 2.4.2 on a different partition (there is simply not enough Lazarus in the World!) and copied the fpc.cfg file from there. I put it in the /etc directory and  everything was fine. SOLUTION: Make sure that a standard fpc.cfg is in /etc or in your home directory. QUESTION 1: Where could I get a copy of fpc.cfg from if I didn't have one already? QUESTION 2: Is fpc.cfg the same for all versions of fpc? (There doesn't seem to be anything version-specific in it.) ---------------------------------------------------------------------- BigChimp · 2012-03-06 05:51 Question 1: (by heart, don't know if this is the correct invocation) fpcmkcfg -o /etc/fpc.cfg. See installation wiki page. fpcmkcfg is in the same directory the compiler binary is. Question 2: I haven't seen many changes in fpc.cfg between fpc version but note that you can customize it if you want with different search paths etc. ---------------------------------------------------------------------- Eugene Loza · 2014-08-21 07:59 Worked in my case: apt-get remove fpc* lazarus --purge apt-get autoremove --purge rm .lazarus apt-get install lazarus ---------------------------------------------------------------------- Rails · 2014-08-21 12:00 Quote from: Eugene Loza on August 21, 2014, 09:59:23 amWorked in my case: apt-get remove fpc* lazarus --purge apt-get autoremove --purge rm .lazarus apt-get install lazarus Not sure if you realized you were responding to a two year old thread but,    Apt-get autoremove should be used with extreme care. It is supposed to only suggest the removal of no longer needed dependencies, but it isn't foolproof. It sometimes wants to remove such things as locally installed packages. If you do use it, be sure to closely examine it's proposed removals before allowing it to proceed. ---------------------------------------------------------------------- Eugene Loza · 2015-03-02 13:53 I don't remember why I posted in here, but that was definitely for some reason... I can see a warning above the message editor P.S. Just today another similar question arose at VK Lazarus community... about the same contnrs/masks. Addition: in order to remove a directory recoursive delete should be used: rm .lazarus -r Never had any problems with autoremove and everytime accepted everything it proposed... However, I'm not a linux expert, just a user. ---------------------------------------------------------------------- Awesome Programmer · 2015-12-04 20:25 Quote from: Eugene Loza on March 02, 2015, 02:53:24 pmI don't remember why I posted in here, but that was definitely for some reason... I can see a warning above the message editor P.S. Just today another similar question arose at VK Lazarus community... about the same contnrs/masks. Addition: in order to remove a directory recoursive delete should be used: rm .lazarus -r Never had any problems with autoremove and everytime accepted everything it proposed... However, I'm not a linux expert, just a user. Eugene, FINALLY your setups worked for me... For the first time since I installed Lazarus on Raspberry PI, I am successfully able to install components without any errors. Unfortunately, one of your step KILLED the Raspberry PI network connection completely. ---------------------------------------------------------------------- Awesome Programmer · 2015-12-04 20:36 Quote from: Rails on August 21, 2014, 02:00:37 pm Quote from: Eugene Loza on August 21, 2014, 09:59:23 amWorked in my case: apt-get remove fpc* lazarus --purge apt-get autoremove --purge rm .lazarus apt-get install lazarus Not sure if you realized you were responding to a two year old thread but,    Apt-get autoremove should be used with extreme care. It is supposed to only suggest the removal of no longer needed dependencies, but it isn't foolproof. It sometimes wants to remove such things as locally installed packages. If you do use it, be sure to closely examine it's proposed removals before allowing it to proceed. I think that's what killed my Raspberry PI network completely.... and I had to redo my Raspberry PI system from scratch by installing Raspbein...