Recent

Author Topic: Problem has suddenly appeared [Resolved]  (Read 2289 times)

KesterKick

  • New Member
  • *
  • Posts: 30
Problem has suddenly appeared [Resolved]
« on: June 23, 2022, 10:45:51 pm »
I have two desktop computers both running the Linux Mint 20.0.3 XFCE operating system and both with Lazarus 2.0.6 installed. Lazarus in one is fine but an odd problem has occurred in the other as follows.  While starting a new project and working on it is ok while I remain in Lazarus, once I save my project and exit Lazarus the problem begins. When I load my saved project, Lazarus opens and displays a blank form.  If I toggle Unit/Form the original form appears along with the blank form - both are labelled Form1.  When I try to run the project it is the blank form that appears.  I notice also that the tabs in the edit window show two units one labelled 'unit1' and the other 'Unit1(2)' (the use of the capital 'U' in the second unit may be significant or not).  The unit1 is a new unit and Unit1(2) contains my original programming.  The problem also affects all my old projects which worked perfectly until a couple of days ago.  Fortunately I had copied the executable file from these projects to another location so I can run the programs but the executables within the project folders exhibit the same problem.

I have uninstalled Lazarus completely and re-installed with no improvement so it seems that the problem is with a dependency that is not an actual part of the installation.

Any suggestions would be welcome.
« Last Edit: July 01, 2022, 05:58:48 pm by KesterKick »

MarkMLl

  • Hero Member
  • *****
  • Posts: 6676
Re: Problem has suddenly appeared
« Reply #1 on: June 24, 2022, 08:55:17 am »
To try to get the ball rolling: are there any symlinks in the paths via which your project, any libraries etc., the Lazarus files and the FPC sources are accessed?

I'd suggest also looking carefully at the commands being used to start the IDE, and seeing whether you can replicate the problem from a shell session (which might also produce some useful error messages).

In particular, look to see whether the --pcp option is involved, and possibly then look at project options to see whether there's something odd in there although it sounds more like an IDE issue than an FPC invocation issue.

MarkMLl
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

KesterKick

  • New Member
  • *
  • Posts: 30
Re: Problem has suddenly appeared
« Reply #2 on: June 24, 2022, 09:52:14 am »
Hi Mark,

Thanks for your quick response.  I am a bit out of my depth with most of your reply - for example how do I start a shell session? Where and how do I check the --pp option?  Although reasonably competent on the computer I'm still a fairly basic user of Lazarus so please forgive my naivety in this area.

MarkMLl

  • Hero Member
  • *****
  • Posts: 6676
Re: Problem has suddenly appeared
« Reply #3 on: June 24, 2022, 10:02:19 am »
Hi Mark,

Thanks for your quick response.  I am a bit out of my depth with most of your reply - for example how do I start a shell session? Where and how do I check the --pp option?  Although reasonably competent on the computer I'm still a fairly basic user of Lazarus so please forgive my naivety in this area.

(Wince :-) I'm not sure that this is the best place to discuss elementary Linux topics, but (a) depending on the details of the GUI that your variant of Linux provides look for "Konsole" on KDE or some variant of a "terminal emulator" etc. (b) Check your options via whatever the GUI provides for menu entries, and look for the --pcp option... any discussion of pp(something) is different. Then transfer the command to your shell session and investigate what happens.

I think you also need to make clear where you got that particular Lazarus: did it come with the distro or whence did you download it?

MarkMLl
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

tetrastes

  • Sr. Member
  • ****
  • Posts: 473
Re: Problem has suddenly appeared
« Reply #4 on: June 24, 2022, 11:43:48 am »
I notice also that the tabs in the edit window show two units one labelled 'unit1' and the other 'Unit1(2)' (the use of the capital 'U' in the second unit may be significant or not).  The unit1 is a new unit and Unit1(2) contains my original programming. 

Check if you didn't rename somehow your original unit1.pas to Unit1.pas, as Linux file system is case sensitive.

MarkMLl

  • Hero Member
  • *****
  • Posts: 6676
Re: Problem has suddenly appeared
« Reply #5 on: June 24, 2022, 11:55:47 am »
I notice also that the tabs in the edit window show two units one labelled 'unit1' and the other 'Unit1(2)' (the use of the capital 'U' in the second unit may be significant or not).  The unit1 is a new unit and Unit1(2) contains my original programming. 

Check if you didn't rename somehow your original unit1.pas to Unit1.pas, as Linux file system is case sensitive.

Very good point. And the underlying FPC compiler tries to "do the right thing", so it's reasonable to expect the IDE to try to "do the right thing"... and I'm sure that I'm not the only person to find that when one tries to "do the right thing" it invariably becomes a nightmare :-)

MarkMLl
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

KesterKick

  • New Member
  • *
  • Posts: 30
Re: Problem has suddenly appeared
« Reply #6 on: June 24, 2022, 09:08:06 pm »
Thanks everyone for your comments.

Having completely removed Lazarus 2.0.6 including '.lazarus', I downloaded the three deb files required for Lazarus 2.2.2.2 but two of them failed to install producing error messages in the terminal. Having one or two non-related minor issues I decided to use a two and a half week old image backup file. That worked well and after running the updater (there were quite a few to get) I tried Lazarus 2.0.6 again as it was there when I created the backup. It seemed OK at first but the problem was there on the second use - obviously the problem was not recently introduced as I had thought - I hadn't used the program for many months.and wanted to create a password generator which was the project I was working on when I noticed the problem.  I thought it was something I had done on this latest project but clearly the problem is months old.

As I have spent so much time on the Lazarus issue and am not feeling too well at the moment, I decided to remove Lazarus from the system including the projects. I have Lazarus working correctly on another desktop and managed to complete my password generator on that system. Fortunately I have copies of all my major projects on that system so any of my programs I require on the system that had the faulting Lazarus  can be used importing the executable from the project on the other system. In effect I have not lost much and gained a tiny amount of drive space.  I may return to the issue when I feel a bit perkier but at eighty plus years old it won't be a top priority for me.

Cheers and thanks again.  Your willingness to respond and give suggestions is much appreciated.

MarkMLl

  • Hero Member
  • *****
  • Posts: 6676
Re: Problem has suddenly appeared
« Reply #7 on: June 24, 2022, 10:26:11 pm »
Hope you feel better before too long.

MarkMLl
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

KesterKick

  • New Member
  • *
  • Posts: 30
Re: Problem has suddenly appeared
« Reply #8 on: June 26, 2022, 07:21:10 pm »
Hi All,

Thanks again all and thanks Mark for your good wishes. 

Again I tried installing version 2.0.6, which is in the Mint repository (and which was what I had for the original installation that had worked well for a few years until the recently discovered problem) having searched for and removed any Lazarus related material remaining after uninstalling.  It worked OK for the first mini test project but the same problem appeared the second time I ran the project (i.e. opening with a new blank form though the original form could be shown by the toggle unit/form method and two units (my original unit now tabbed as 'Unit1(2)' and a new unit, with no procedures, tabbed as unit1.  Both forms are named 'Form1'.

What I can do is, create a new project, save it and extract/copy the executable from the project folder before reloading the project.  That executable will work but once the project is loaded back into Lazarus, the executable left in the project folder or new one created, exhibits the blank form problem.

Linux Mint is due for a new LTS version shortly so I thought it is probably best I wait until then and do afresh full installation then (not just an update0.  That way I should have cleared out whatever has caused the problem.  I know that is avoiding the issue but it will be less of a headache.

MarkMLl

  • Hero Member
  • *****
  • Posts: 6676
Re: Problem has suddenly appeared
« Reply #9 on: June 26, 2022, 11:24:29 pm »
I don't know whether anybody around here has specific experience of Mint, but the problem there is that whoever built that package might have scre^H^H^H^H configured things in a way unexpected by the developers etc. here.

You might possibly do better getting FPC 3.2 installed from the distro's repository (or, if they don't yet have it, from the downloads link at the left of this page) and then either installing Lazarus from this site (i.e. again, left of this page). Or possibly even building Lazarus from source, which really isn't all that difficult.

MarkMLl
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

dbannon

  • Hero Member
  • *****
  • Posts: 2786
    • tomboy-ng, a rewrite of the classic Tomboy
Re: Problem has suddenly appeared
« Reply #10 on: June 27, 2022, 09:54:59 am »
No, I doubt Mint will have a current FPC yet, the one KK is using is based on Ubuntu 20.04 and that has only FPC 3.0.4

So, as Mark suggested, get FPC and Lazarus from the FPC/Lazarus sourceforge repos instead. Probably a good idea to make sure the Mint repo ones are removed first. Note you may need to "resolve dependencies", that is install some other packages that FPC needs. The best and easiest way to do that is to install the downloaded packages using gdebi, from memory Mint installs it by default. gdebi will take care of the dependencies for you.

But I suggest the underlying problem relates to having files in your working area that have matching names except for the case of the letters. Its about all that could explain these strange goings on. Mint itself is most unlikely to do anything that would cause such a problem. So, starting again, with a totally empty working directory should make sense.

Stick with all lowercase file names and don't rename Lazarus files outside of Lazarus.

If you make no progress, let us know. I have Linux Mint VM with me and I can try to replicate your problem if possible.

Davo
Lazarus 3, Linux (and reluctantly Win10/11, OSX Monterey)
My Project - https://github.com/tomboy-notes/tomboy-ng and my github - https://github.com/davidbannon

MarkMLl

  • Hero Member
  • *****
  • Posts: 6676
Re: Problem has suddenly appeared
« Reply #11 on: June 27, 2022, 10:32:43 am »
If you make no progress, let us know. I have Linux Mint VM with me and I can try to replicate your problem if possible.

I'm sympathetic and interested, but am still somewhat hobbled after my main development system was apparently blown up by a mains glitch.

I normally start off with a binary FPC loaded from the link on the left, and while my preference is to rebuild it from source that isn't necessary.

My notes show that on Debian building Lazarus for gtk2 needs the libgtk2.0-dev package.

MarkMLl
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

KesterKick

  • New Member
  • *
  • Posts: 30
Re: Problem has suddenly appeared
« Reply #12 on: June 29, 2022, 07:55:31 pm »
Although I said I would leave things be until after the next LTS version of Mint is released, I have persevered but with no success.  The latest attempt was to download the Lazarus deb files from Sourceforge and install them via the terminal but I got error messages even though I followed the instructions to the letter. 

One thing that really puzzles me is why suddenly the problem affected all my projects many of which have been working perfectly for years and have not been edited for ages.  Neither have I fiddled about with file names; I stick with the defaults but place each project in a folder I give a special name to signify the project contained.  My projects tend to be fairly simple in format and do not normally contain multiple forms and never multiple units.  Whatever has happened to cause the problem, if I am the cause (the most likely reason I suppose) it would be through a slip carried out unknowingly.

Anyway, it is great to know that you guys are out there and so willing to come to my aid.  I'm happily using Lazarus on my other Mint system and on my Windows 7 system which dual boots with the Mint with the Lazarus problem.  I may not be reporting back too frequently, not because I can't be bothered but because trying to get to the bottom of the problem is very time consuming and somewhat frustrating.  I will report back when I have got somewhere and I will keep checking on this thread of the forum regularly.

Thanks all.  Cheers.

dbannon

  • Hero Member
  • *****
  • Posts: 2786
    • tomboy-ng, a rewrite of the classic Tomboy
Re: Problem has suddenly appeared
« Reply #13 on: June 30, 2022, 12:39:32 am »
" error messages" - while installing or the same ones you see mention at the start of this thread ?

If its while installing, please share.

Davo
Lazarus 3, Linux (and reluctantly Win10/11, OSX Monterey)
My Project - https://github.com/tomboy-notes/tomboy-ng and my github - https://github.com/davidbannon

KesterKick

  • New Member
  • *
  • Posts: 30
Re: Problem has suddenly appeared
« Reply #14 on: June 30, 2022, 07:35:22 pm »
Hi All,

Some good news; Davo, I don't need to send you error messages re the new installation because eventually I resolved that problem.  There was stuff left on the system from a previous installation yet I could not find it.  The error messages during the install via the terminal related to these items.  A physical search of my system failed to find these files so, although not very experienced in using the terminal, I ran the install process again in the terminal and then, when an error occurred, used the 'sudo apt-get purge' command followed by the errant file name.  Well the terminal found the file and removed it.  I had to use this process at least a couple times more and then the installation completed successfully.

The next thing was to create a couple of simple test projects.  This I did but after saving them, the problem I first reported appeared to resurrect itself with blank a form appearing (although only one but empty unit).  I had tried to load the project from the project folder.  Clearly that was not going to work so I tried opening directly from the Lazarus program using the 'Project' dropdown menu and opening 'Recent Projects'.  That did the trick.  So it seems this was my error all along and having not used Lazarus for a long time, I'd forgotten that was how I opened projects previously.  It's puzzling though that this is not necessary on my Windows 7 setup nor, so far, on my other Mint system.

The culprit files were fpc-3.0.4, fp-compiler, fp-units-rtl-3.0.4.

One other thing with which I am not familiar but happens with my new installation is that when I first do a test run of my project I get the following message: 'The project does not write debug info in Dwarf format.  The "FPDebug internal Dwarf debugger" supports only Dwarf.  I am then given three options: 'Enable Dwarf 3 (-gw3)', 'Enable Dwarf 2 (-gw)' and 'Enable Dwarf 2 with sets'.  So far I have used the middle option.

Well that's my update of the situation.  Thanks for your support - I hope I haven't wasted too much of your time because the problem seems to have been due to inadequacies on my part.  I'll give a few more days before marking the thread as resolved.

Cheers.

 

TinyPortal © 2005-2018