Totally confused: "Cannot find unit gettext" lazarus / 1-Linux ---------------------------------------------------------------------- mikea105 · 2015-12-16 04:25 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 · 2015-12-16 05:23 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 · 2015-12-17 01:22 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 · 2015-12-17 06:55 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 · 2015-12-18 04:56 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 · 2015-12-18 06:18 QuoteDoes 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][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i /usr/bin/bi n2obj/usr/bin/data2inc/usr/bin/delp/usr/bin/fd2pascal/usr/bin/fpc/usr/ bin/fpcmake/usr/bin/fpcmkcfg/usr/bin/fpcsubst/usr/bin/fpdoc/usr/bin/fp pkg/usr/bin/fprcp/usr/bin/h2pas/usr/bin/h2paspp/usr/bin/makeskel/usr/b in/mkxmlrpc/usr/bin/plex/usr/bin/postw32/usr/bin/ppcppc/usr/bin/ppcx64 /usr/bin/ppdep/usr/bin/ppudump/usr/bin/ppufiles/usr/bin/ppumove/usr/bi n/ptop/usr/bin/pyacc/usr/bin/rmcvsdir/usr/bin/rstconv/usr/bin/unitdiff ---------------------------------------------------------------------- marcov · 2015-12-18 09:01 (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 · 2015-12-18 13:25 @GetMem: If you want to know which version is chosen, simply useCode: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i 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. ---------------------------------------------------------------------- balazsszekely · 2015-12-18 14:12 QuoteIf you want to know which version is chosen, simply use whereis fpcThanks Thaddy! I wasn't aware of this command. Quotemaybe 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... ---------------------------------------------------------------------- Thaddy · 2015-12-18 14:40 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. ---------------------------------------------------------------------- mikea105 · 2015-12-19 05:25 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 · 2015-12-19 07:20 @Thaddy QuoteThe 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 QuoteNow 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.debThis 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 /). QuoteIn the past, I just double clicked them and let Gdebi install them.  Is that what I should do now?Yes. QuoteI 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 · 2015-12-19 08:57 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 ---------------------------------------------------------------------- balazsszekely · 2015-12-19 10:13 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 · 2015-12-19 10:41 @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. ---------------------------------------------------------------------- balazsszekely · 2015-12-19 11:11 @Thaddy Ubuntu 14.04 LTS(see attachments): ---------------------------------------------------------------------- mikea105 · 2015-12-20 06:02 Everything is now a total dog's breakfast.  After deleting the files in the list and the gettext directory, I somehow managed to thrash the operating system.  It will now boot only into terminal mode, and I have no idea where to go from here.  I found a page that talked about how to fix nvidia driver problems (which I fixed before), but now the nvidia-detect program won't run, even though I used apt-get remove and then apt-get install for it.  apt-get says it worked fine installing it, but the program simply won't run. And it's constantly complaining about wanting me to install fpc.  I got desperate enough to start to reinstall Mint, but the installer keeps bitching about not having a root.  I finally got it to set the mount point to the root of the drive where Mint is installed, and then it says it's going to delete the whole system (and possibly everything else) when I reinstall it and asks if everything is backed up.  I aborted the reinstall.  I don't know what to do now.  No idea at all.  Don't even know if I can save my data.  I'm too ignorant of Linux to know how to fix this or to dare to mess around with it on my own because I'm sure I'll just destroy my email archives, documents and everything else.  (I'm wondering if I can save those somehow.)  This started as a glitch with lazarus and is now a death spiral for my whole Linux install.  Does anyone have any ideas on how I might be able to save anything?  I'd like to at least save my working files and email archives.  Ideally, I'd like to get Mint working again.  I might even be brave enough to try Lazarus again if I manage to save my data somehow.  I've used Mint for several months now, and it's been great -- until this nightmare started.  Can anyone help? ---------------------------------------------------------------------- mikea105 · 2015-12-24 04:27 Okay, I think this is as solved as it's going to be.  I ended up having to use the nuclear option     Not only formatted the drive, but had to use gparted to delete the partition because the installer wouldn't work otherwise. Fortunately, I was able to boot with a DVD and copy my home directory off beforehand, so although it's going to be a pain to bring the computer back to where it was, at least it's possible, eventually. Thanks to everyone who posted for their help! ---------------------------------------------------------------------- VincePelss · 2017-11-11 01:16 Quote from: mikea105 on December 18, 2015, 05:56:52 amOkay, 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. This happened to me. My solution was to delete the equivalent file below: home/fred/.fpc.cfg ---------------------------------------------------------------------- Handoko · 2017-11-11 03:13 Sometimes simply deleting fpc.cfg is not enough. For example I tried to combine Lazarus with FPC version that not compatible, it ended with buggy result. The fix it, I need only to do a complete Lazarus/FPC removal. Read more (see the detail of step #1): http://forum.lazarus.freepascal.org/index.php/topic,38828.msg265293.ht ml#msg265293 My solution has never failed so far. ---------------------------------------------------------------------- guest58172 · 2017-11-11 10:05 Quote from: GetMem on December 17, 2015, 07:55:51 amThe 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 Exactly looks like something that could be indicated in a better error message (even w/o elevated verbosity), particularly since the question comes often.