Recent

Author Topic: Totally confused: "Cannot find unit gettext"  (Read 15445 times)

mikea105

  • New Member
  • *
  • Posts: 14
Totally confused: "Cannot find unit gettext"
« on: December 16, 2015, 05:25:46 am »
I had Lazarus working perfectly.  Then it got wonky for no reason I could fathom, so I decided to uninstall it, then reinstall it.  It appears to reinstall okay, but when I try to even run a simple program (1 form, 1 button on it), I get the following:

lazutf8.pas(171,3) Fatal: Cannot find unit gettext used by LazUTF8 of package LazUtils.

Discussion of this sort of thing seems to center around something to do with paths or bad config files.  I've hunted down and killed every config file I can find, uninstalled and reinstalled Lazarus (and FPC), and can't get anything to work.  There is a "gettext.pp" in /usr/share/fpcsrc/2.6.4/packages/fcl-base/src and in /usr/lib/fpc/2.6.4/units/x86_64-linux/fcl-base.  Is there supposed to be another one someplace?

I'm completely dead in the water now.  Any help would be greatly appreciated!


balazsszekely

  • Guest
Re: Totally confused: "Cannot find unit gettext"
« Reply #1 on: December 16, 2015, 06:23:59 am »
Hi mikea105,

Please try the following:
1. Lazarus Menu-->Tools-->Rescan FPC Source Directory
2. If 1 does not help, delete the config dir:  ~/.lazarus

regards,
GetMem

mikea105

  • New Member
  • *
  • Posts: 14
Re: Totally confused: "Cannot find unit gettext"
« Reply #2 on: December 17, 2015, 02:22:54 am »
Thanks for your reply.  I've tried both of your suggestions, and I still have the same, exact problem. 

I don't know if this will help, but when it shows the error message, it opens the LazUTF8 module and highlights "gettext" directly under "uses" right under "implementation" in that unit. 

Any other ideas I can try?  Please??   


balazsszekely

  • Guest
Re: Totally confused: "Cannot find unit gettext"
« Reply #3 on: December 17, 2015, 07:55:51 am »
The error message: "Cannot find unit ..."  can happen for two reasons:
  1. The file is missing
  2. The file is present but it's the wrong version
Since you deleted everything(lazdir(/usr/share/lazarus), lazconfigdir( ~/.lazarus), fpcsource(/usr/share/fpcsrc), fpc(/usr/share/fpc)), and reinstalled lazarus, non of them it's true in your case.
You can try one more thing: go to Lazarus Menu-->Project-->Project Options-->Compiler Options-->Verbosity then check -vu and -vt. Make sure the message filter it's not on(right click the message window, uncheck filters). This will give you more info about the compiled units.

mikea105

  • New Member
  • *
  • Posts: 14
Re: Totally confused: "Cannot find unit gettext"
« Reply #4 on: December 18, 2015, 05:56:52 am »
Okay, I did what you said, and here's everything (using "copy all/original messages to clipboard") from the message window. 

Hint: (11030) Start of reading config file /home/fred/.fpc.cfg
Hint: (11031) End of reading config file /home/fred/.fpc.cfg
Free Pascal Compiler version 2.6.4 [2014/04/20] for x86_64
Copyright (c) 1993-2014 by Florian Klaempfl and others
(1002) Target OS: Linux for x86-64
(3104) Compiling /home/fred/tmp/project1.lpr
Fatal: (10022) Can't find unit gettext used by LazUTF8
Fatal: (1018) Compilation aborted
Error: /usr/bin/ppcx64 returned an error exitcode (normal if you did not specify a source file to be compiled)

Does this help?  I'm at my wit's end (a short trip, I admit).  I've tried uninstalling everything several times.  I've tried installing the older version in Synaptic.  That one won't even pretend to work.  Then I got rid of that and put back version 2.6.4 which this is.  It works fine -- until I try to compile.  I can't begin to imagine what is going on here.  Is there some other set of code/method of installation I can try?  I really have no idea what to do now.  I had Lazarus working once, and it worked fine until something broke, and now I can't even try to compile my partly finished program any more.  It it looks like all the work I did was for nothing.   :'(

Any ideas from anyone would REALLY be appreciated.  How can I get this damn thing to run?  If it helps, I'm using Mint Rafaela. 

balazsszekely

  • Guest
Re: Totally confused: "Cannot find unit gettext"
« Reply #5 on: December 18, 2015, 07:18:32 am »
Quote
Does this help?  I'm at my wit's end (a short trip, I admit).  I've tried uninstalling everything several times.  I've tried installing the older version in Synaptic.  That one won't even pretend to work.  Then I got rid of that and put back version 2.6.4 which this is.  It works fine -- until I try to compile.  I can't begin to imagine what is going on here.  Is there some other set of code/method of installation I can try?  I really have no idea what to do now.  I had Lazarus working once, and it worked fine until something broke, and now I can't even try to compile my partly finished program any more.  It it looks like all the work I did was for nothing.   :'(
Any ideas from anyone would REALLY be appreciated.  How can I get this damn thing to run?  If it helps, I'm using Mint Rafaela. 
The only logical explanation is that Lazarus uses the wrong version of the fpc compiler. Somehow you have the old version of fpc inside the bin folder. Please delete all fpc releated files from /usr/bin.Reinstall lazarus again. If this those not help I'm out of ideas.
Code: Pascal  [Select][+][-]
  1. /usr/bin/bin2obj
  2. /usr/bin/data2inc
  3. /usr/bin/delp
  4. /usr/bin/fd2pascal
  5. /usr/bin/fpc
  6. /usr/bin/fpcmake
  7. /usr/bin/fpcmkcfg
  8. /usr/bin/fpcsubst
  9. /usr/bin/fpdoc
  10. /usr/bin/fppkg
  11. /usr/bin/fprcp
  12. /usr/bin/h2pas
  13. /usr/bin/h2paspp
  14. /usr/bin/makeskel
  15. /usr/bin/mkxmlrpc
  16. /usr/bin/plex
  17. /usr/bin/postw32
  18. /usr/bin/ppcppc
  19. /usr/bin/ppcx64
  20. /usr/bin/ppdep
  21. /usr/bin/ppudump
  22. /usr/bin/ppufiles
  23. /usr/bin/ppumove
  24. /usr/bin/ptop
  25. /usr/bin/pyacc
  26. /usr/bin/rmcvsdir
  27. /usr/bin/rstconv
  28. /usr/bin/unitdiff
« Last Edit: December 18, 2015, 07:36:37 am by GetMem »

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11383
  • FPC developer.
Re: Totally confused: "Cannot find unit gettext"
« Reply #6 on: December 18, 2015, 10:01:06 am »
(Looking at dates of those binaries could be a illuminating too. I really hate the *nix principle of stuffing all binaries indiscriminately in a directory)

Thaddy

  • Hero Member
  • *****
  • Posts: 14210
  • Probably until I exterminate Putin.
Re: Totally confused: "Cannot find unit gettext"
« Reply #7 on: December 18, 2015, 02:25:45 pm »
@GetMem:
If you want to know which version is chosen, simply use
Code: Pascal  [Select][+][-]
  1. whereis fpc
The first one that turns up is the one that is used unless explicitly and  properly specified in the config files or in the environment.

maybe something like a version in /usr/bin and /usr/local/bin or a wrong symlink in one of those.

The two locations for gettext are ok except the first is a source directory and the second should hold the .ppu and the .o compiled version of it.
« Last Edit: December 18, 2015, 02:34:58 pm by Thaddy »
Specialize a type, not a var.

balazsszekely

  • Guest
Re: Totally confused: "Cannot find unit gettext"
« Reply #8 on: December 18, 2015, 03:12:37 pm »
Quote
If you want to know which version is chosen, simply use whereis fpc
Thanks Thaddy! I wasn't aware of this command.

Quote
maybe something like a version in /usr/bin and /usr/local/bin or a wrong symlink in one of those.
That's why I suggested to the OP to delete all the file inside the bin folder. By the way, is there a script somewhere that removes all fpc related files under linux? I always install lazarus/fpc under ~/development directory. So I can remove it with Shift + Del(if necessary), but the official installer creates so many files in so many places...
« Last Edit: December 18, 2015, 03:22:04 pm by GetMem »

Thaddy

  • Hero Member
  • *****
  • Posts: 14210
  • Probably until I exterminate Putin.
Re: Totally confused: "Cannot find unit gettext"
« Reply #9 on: December 18, 2015, 03:40:02 pm »
This is fpc specific and may be different for Lazarus.
The installer doesn't install in the bin directory, it only installs two symlinks.
The files are actually mostly installed in /usr/local/lib/fpc/x.x.x but I'll do a write-up later.
Specialize a type, not a var.

mikea105

  • New Member
  • *
  • Posts: 14
Re: Totally confused: "Cannot find unit gettext"
« Reply #10 on: December 19, 2015, 06:25:08 am »
First, my thanks to everyone who's posted here to try to help. I certainly need all the help I can get!

Now, I've gone through and used locate and whereis and found (I think) every reference I can to FPC, including every file in the list posted here by GetMem (thanks!).  I also looked for and destroyed the GETTEXT directory there.  I've uninstalled FPC, too, using Gdebi, which is how I installed it.  I also ran sudo apt-get update just to try to make sure everything was up-to-date and, hopefully, stable.

Now I'm ready to try to reinstall FPC and Lazarus, but I wanted to see if I'm doing that right.  Maybe I'm doing something wrong, or there's a better way.  I downloaded these three packages from sourceforge and installed them in this order:
fpc_2.6.4-150228_amd64.deb
fpc-src_2.6.4-150228_amd64.deb
lazarus_1.4.4-0_amd64.deb

In the past, I just double clicked them and let Gdebi install them.  Is that what I should do now?  Or should I try something else?  I saw a reference to building FPC and Lazarus form source, but I'm not sure how to do that or even that would be a good idea.

What's my next move?  Again, thanks in advance for your help!

balazsszekely

  • Guest
Re: Totally confused: "Cannot find unit gettext"
« Reply #11 on: December 19, 2015, 08:20:36 am »
@Thaddy
Quote
The installer doesn't install in the bin directory, it only installs two symlinks.
I double checked this in one of my VM, the bin directory is full with fpc files( the files I posted above).

@mikea105
Quote
Now I'm ready to try to reinstall FPC and Lazarus, but I wanted to see if I'm doing that right.  Maybe I'm doing something wrong, or there's a better way.  I downloaded these three packages from sourceforge and installed them in this order:
fpc_2.6.4-150228_amd64.deb
fpc-src_2.6.4-150228_amd64.deb
lazarus_1.4.4-0_amd64.deb
This is the correct order, but I would switch to fpc 3.0.0 and lazarus 1.6 instead of you. Is there any specific reason to stay with 1.4? Ok, officially 1.6 is still under development, but in my opinion is stable enough(http://sourceforge.net/projects/lazarus/files/Lazarus%20Linux%20amd64%20DEB/Lazarus%201.6RC1/).

Quote
In the past, I just double clicked them and let Gdebi install them.  Is that what I should do now?
Yes.

Quote
I saw a reference to building FPC and Lazarus form source, but I'm not sure how to do that or even that would be a good idea.
It's a non-trivial operation, I would skip it for now. Anyway if you really want to try it, you have two choices:
  1. fpcup(https://github.com/LongDirtyAnimAlf/Reiniero-fpcup)
  2. GetLazarus(http://www.getlazarus.org/setup/?download#linux)
Non of them will interfere with your "official installation". Both install all files(fpc,lazarus) in a separate directory(~development)

PS: Perhaps the best solution would be, to install lazarus 1.4(official release) then install  Lazrus 1.6 with fpcup/getlazarus.
 

Thaddy

  • Hero Member
  • *****
  • Posts: 14210
  • Probably until I exterminate Putin.
Re: Totally confused: "Cannot find unit gettext"
« Reply #12 on: December 19, 2015, 09:57:35 am »
Yes, you are right. I forgot the symlinks are only for the compiler(s) itself. My mistake. The utilities are indeed located in the bin.
But still, the compiler itself is in /usr/local/lib/fpc/x.x.x/ and there exists only a symlink in /usr/local/bin with a standard install on Debian.
So to determine the compiler that is used, you have to check the symlink in /usr/local/bin and also look if there isn't anything in/usr/bin. Or run whereis and check the symlink
« Last Edit: December 19, 2015, 10:09:47 am by Thaddy »
Specialize a type, not a var.

balazsszekely

  • Guest
Re: Totally confused: "Cannot find unit gettext"
« Reply #13 on: December 19, 2015, 11:13:49 am »
My /usr/local/lib folder is empty(actually contains two python libraries but no fpc file/folder). Anyway @mikea105 make sure you also delete /usr/local/lib/fpc then reinstall Lazarus 1.4.  In my opinion you will succeed this time.

Thaddy

  • Hero Member
  • *****
  • Posts: 14210
  • Probably until I exterminate Putin.
Re: Totally confused: "Cannot find unit gettext"
« Reply #14 on: December 19, 2015, 11:41:40 am »
@getmem: Just to ask: what distribution are you using? On Debian and derivatives it should be as I explained.
Just tested this again on a fresh snapshot.
Specialize a type, not a var.

 

TinyPortal © 2005-2018