Recent

Author Topic: [SOLVED] Can't find unit contnrs used by masks  (Read 16534 times)

HappyLarry

  • Full Member
  • ***
  • Posts: 155
[SOLVED] Can't find unit contnrs used by masks
« on: March 02, 2012, 07:47:06 pm »
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:
Quote
Can't find unit contnrs used by masks
I have searched the Internet and this seems to be quite a common problem - unfortunately I couldn't find an answer.
Any ideas?
« Last Edit: March 05, 2012, 09:11:37 pm by HappyLarry »
Use Lazarus and Free Pascal and stand on the shoulders of giants . . . very generous giants. Thank you.

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 12645
  • FPC developer.

HappyLarry

  • Full Member
  • ***
  • Posts: 155
Re: Can't find unit contnrs used by masks
« Reply #2 on: March 03, 2012, 02:28:24 pm »
Thanks marcov
The link says
Quote
2.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.
Use Lazarus and Free Pascal and stand on the shoulders of giants . . . very generous giants. Thank you.

Chronos

  • Sr. Member
  • ****
  • Posts: 256
    • PascalClassLibrary
Re: Can't find unit contnrs used by masks
« Reply #3 on: March 03, 2012, 11:03:39 pm »
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

  • Full Member
  • ***
  • Posts: 155
[SOLVED] Can't find unit contnrs used by masks
« Reply #4 on: March 05, 2012, 08:48:36 pm »
Good one Chronos!    :o :D :D
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  ;D 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.)
« Last Edit: March 05, 2012, 09:13:54 pm by HappyLarry »
Use Lazarus and Free Pascal and stand on the shoulders of giants . . . very generous giants. Thank you.

BigChimp

  • Hero Member
  • *****
  • Posts: 5740
  • Add to the wiki - it's free ;)
    • FPCUp, PaperTiger scanning and other open source projects
Re: [SOLVED] Can't find unit contnrs used by masks
« Reply #5 on: March 06, 2012, 06:51:19 am »
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.
Want quicker answers to your questions? Read http://wiki.lazarus.freepascal.org/Lazarus_Faq#What_is_the_correct_way_to_ask_questions_in_the_forum.3F

Open source including papertiger OCR/PDF scanning:
https://bitbucket.org/reiniero

Lazarus trunk+FPC trunk x86, Windows x64 unless otherwise specified

Eugene Loza

  • Hero Member
  • *****
  • Posts: 729
    • My games in Pascal
Re: [SOLVED] Can't find unit contnrs used by masks
« Reply #6 on: August 21, 2014, 09:59:23 am »
Worked in my case:

apt-get remove fpc* lazarus --purge
apt-get autoremove --purge
rm .lazarus
apt-get install lazarus
My FOSS games in FreePascal&CastleGameEngine: https://decoherence.itch.io/ (Sources: https://gitlab.com/EugeneLoza)

Rails

  • Guest
Re: [SOLVED] Can't find unit contnrs used by masks
« Reply #7 on: August 21, 2014, 02:00:37 pm »

Worked 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

  • Hero Member
  • *****
  • Posts: 729
    • My games in Pascal
Re: [SOLVED] Can't find unit contnrs used by masks
« Reply #8 on: March 02, 2015, 02:53:24 pm »
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 8)
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.
My FOSS games in FreePascal&CastleGameEngine: https://decoherence.itch.io/ (Sources: https://gitlab.com/EugeneLoza)

Awesome Programmer

  • Sr. Member
  • ****
  • Posts: 479
  • Programming is FUN only when it works :)
    • Cool Technology
Re: [SOLVED] Can't find unit contnrs used by masks
« Reply #9 on: December 04, 2015, 09:25:28 pm »
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 8)
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.
« Last Edit: December 04, 2015, 09:35:49 pm by reltek »

Awesome Programmer

  • Sr. Member
  • ****
  • Posts: 479
  • Programming is FUN only when it works :)
    • Cool Technology
Re: [SOLVED] Can't find unit contnrs used by masks
« Reply #10 on: December 04, 2015, 09:36:36 pm »

Worked 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...  :'(
« Last Edit: December 07, 2015, 05:40:31 pm by reltek »

 

TinyPortal © 2005-2018