Recent

Author Topic: [SOLVED] Lazarus 3.0 on linux does not work  (Read 1246 times)

Codrut1001

  • New Member
  • *
  • Posts: 22
[SOLVED] Lazarus 3.0 on linux does not work
« on: November 29, 2023, 07:03:07 pm »
Since I had some trouble with Lazarus 2.0.6 and the fact that for some reason It didn't have a icon in the start menu, I decided to install Lazarus 3.0.0R2 from the following source:
https://sourceforge.net/projects/lazarus/files/Lazarus%20Linux%20amd64%20DEB/Lazarus%203.0RC2/

I was able to install It successfully, but I have a few issues:

1) Everytime I run a project after starting the IDE, I get a popup asking me to "Choose Debug Information Format"
2) When I close the application by pressing the "X" in the titlebar, the app hangs forever and I need to force close It
3) I cannot have any components on the form, the unit "StdCtrls", "Forms", "Graphics" and many other units cannot be found?
4) I cannot compile the IDE with new packages as some system types cannot be found. Here is the error:
"datetimepicker.pas(85,12) Fatal: Can't find unit DateTimePicker used by DateTimeCtrls"

I have made no changes to the IDE, this is a fresh install.

I use Linux Zorin OS 16.3 x86_64 , which is based on Ubuntu

Did I do something wrong?

I would appreciate any suggestions! :)


Edit:
The answer is, Lazarus 3.0 is broken. Use 2.4.6
« Last Edit: November 30, 2023, 10:30:57 am by Codrut1001 »

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9694
  • Debugger - SynEdit - and more
    • wiki
Re: Lazarus 3.0 on linux does not work
« Reply #1 on: November 29, 2023, 08:31:18 pm »
Have you tried to rebuild the IDE ? Tools => Build Lazarus ?

You may first want to try and fix any PATH, if needed...




Quote
1) Everytime I run a project after starting the IDE, I get a popup asking me to "Choose Debug Information Format"
https://wiki.lazarus.freepascal.org/DWARF
https://wiki.lazarus.freepascal.org/Debugger_Setup#Choosing_the_correct_debugger_backend

Quote
2) When I close the application by pressing the "X" in the titlebar, the app hangs forever and I need to force close It

Is that run with debugger, or run without debugger?

If "with",
- What happens if you press the pause button? What is in the "callstack" window once paused?
- Does it make a difference if you go to Tools > Options > debugger > debugger backend and switch between FpDebug and Gdb?



The other items I am not sure.

For point 3, maybe check the path setting in Tools > options.

Or start your ide with --setup
Then it should open a window, that helps you updating all those paths.



Codrut1001

  • New Member
  • *
  • Posts: 22
Re: Lazarus 3.0 on linux does not work
« Reply #2 on: November 29, 2023, 08:47:35 pm »
Have you tried to rebuild the IDE ? Tools => Build Lazarus ?

You may first want to try and fix any PATH, if needed...




Quote
1) Everytime I run a project after starting the IDE, I get a popup asking me to "Choose Debug Information Format"
https://wiki.lazarus.freepascal.org/DWARF
https://wiki.lazarus.freepascal.org/Debugger_Setup#Choosing_the_correct_debugger_backend

Quote
2) When I close the application by pressing the "X" in the titlebar, the app hangs forever and I need to force close It

Is that run with debugger, or run without debugger?

If "with",
- What happens if you press the pause button? What is in the "callstack" window once paused?
- Does it make a difference if you go to Tools > Options > debugger > debugger backend and switch between FpDebug and Gdb?



The other items I am not sure.

For point 3, maybe check the path setting in Tools > options.

Or start your ide with --setup
Then it should open a window, that helps you updating all those paths.

The app hangs when I press x even when I run the executable from the file browser. So there are some issues with compilation.

I cannot open lazarus with the "--setup" parameter, as when I open the IDE from the terminal, it hangs.

Tools -> Build Lazarus fails with the following:
datetimepicker.pas(85,12) Fatal: Can't find unit DateTimePicker used by DateTimeCtrls

Lazarus 3 is not in the Ubuntu Software app, only 2.0.6. Could It be that It's not ready to be used yet?

dbannon

  • Hero Member
  • *****
  • Posts: 2750
    • tomboy-ng, a rewrite of the classic Tomboy
Re: Lazarus 3.0 on linux does not work
« Reply #3 on: November 30, 2023, 12:46:02 am »
The app hangs when I press x even when I run the executable from the file browser. So there are some issues with compilation.
By the 'app' you mean the IDE ? That and the fact that your initial debug settings are not being save sort of indicates your config directory might be read only ? Please
Code: Pascal  [Select][+][-]
  1. ls -la ~/.lazarus

I cannot open lazarus with the "--setup" parameter, as when I open the IDE from the terminal, it hangs.
OK, but it does attempt to start ?  Its shows some text information during that attempt, please show us that text.

Tools -> Build Lazarus fails with the following:
datetimepicker.pas(85,12) Fatal: Can't find unit DateTimePicker used by DateTimeCtrls
Someone else had a problem with datetimepicker a month of so ago, might be worthwhile searching the forum.

Lazarus 3 is not in the Ubuntu Software app, only 2.0.6. Could It be that It's not ready to be used yet?
No, it means you are using a Distro based on an older version of Ubuntu. Ubuntu does not update apps in a repo unless there are security implications. Thats not a big deal, I am using Ubuntu 20.04 and it has Lazarus 2.0.6 in its official repo. I don't use it of course, I build Lazarus from source, easy.

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

Codrut1001

  • New Member
  • *
  • Posts: 22
Re: Lazarus 3.0 on linux does not work
« Reply #4 on: November 30, 2023, 09:07:39 am »
The app hangs when I press x even when I run the executable from the file browser. So there are some issues with compilation.
By the 'app' you mean the IDE ? That and the fact that your initial debug settings are not being save sort of indicates your config directory might be read only ? Please
Code: Pascal  [Select][+][-]
  1. ls -la ~/.lazarus

By "app", I meant the application built by lazarus. "Project1".

Running
Code: [Select]
ls -la ~/.lazarus showed all files with the permission rw-rw-r

I was able to open "startlazarus" with the "--setup" parameter, and It launched. The setup window showed everything as being "ok".
Here is the output of the app:
Code: Pascal  [Select][+][-]
  1. Adding "--setup" as a parameter
  2. Info: (startlazarus) [TLazarusManager.Run] starting /usr/share/lazarus/3.0.0/lazarus ...
  3. Info: (startlazarus) [TLazarusManager.Run] exe=/usr/share/lazarus/3.0.0/lazarus Params=[--started-by-startlazarus
  4. --no-splash-screen
  5. --setup
  6. --force-new-instance
  7. ]
  8. Hint: (lazarus) [TMainIDE.ParseCmdLineOptions] PrimaryConfigPath="/home/codrut/.lazarus"
  9. Hint: (lazarus) [TMainIDE.ParseCmdLineOptions] SecondaryConfigPath="/etc/lazarus"
  10. Looking for code tools config file:  "/home/codrut/.lazarus/codetoolsoptions.xml"
  11. NOTE: codetools config file not found - using defaults
  12. SearchLazarusDirectoryCandidates Value=/usr/share/lazarus/3.0.0 File=/usr/share/lazarus/3.0.0
  13. SearchLazarusDirectoryCandidates Value=/usr/share/lazarus File=/usr/share/lazarus
  14. SearchLazarusDirectoryCandidates Value=/usr/local/share/lazarus File=/usr/local/share/lazarus
  15. SearchLazarusDirectoryCandidates Value=/usr/local/lib/lazarus File=/usr/local/lib/lazarus
  16. SearchLazarusDirectoryCandidates Value=/usr/local/lazarus File=/usr/local/lazarus
  17. SearchLazarusDirectoryCandidates Value=/usr/lib/lazarus File=/usr/lib/lazarus
  18. SearchLazarusDirectoryCandidates Value=/usr/lib/lazarus/3.0RC1 File=/usr/lib/lazarus/3.0RC1
  19. SearchLazarusDirectoryCandidates Value=~/pascal/lazarus File=/home/codrut/pascal/lazarus
  20. SearchLazarusDirectoryCandidates Value=~/lazarus File=/home/codrut/lazarus
  21. SearchLazarusDirectoryCandidates Value=/usr/lib/lazarus File=/usr/lib/lazarus
  22. SearchCompilerCandidates Value=/usr/bin/fpc File=/usr/bin/fpc
  23. SearchCompilerCandidates Value=fpc File=/usr/bin/fpc
  24. SearchCompilerCandidates Value=ppcx64 File=/usr/bin/ppcx64
  25. SearchCompilerCandidates Value=/usr/local/bin/fpc File=/usr/local/bin/fpc
  26. SearchCompilerCandidates Value=/opt/fpc/fpc File=/opt/fpc/fpc
  27. SearchCompilerCandidates Value=$(LazarusDir)/fpc/3.2.2/bin/x86_64-linux/fpc File=/usr/share/lazarus/3.0.0/fpc/3.2.2/bin/x86_64-linux/fpc
  28. SearchCompilerCandidates Value=$(LazarusDir)/fpc/bin/x86_64-linux/fpc File=/usr/share/lazarus/3.0.0/fpc/bin/x86_64-linux/fpc
  29. SearchCompilerCandidates Value=/usr/local/bin/fpc File=/usr/local/bin/fpc
  30. SearchCompilerCandidates Value=/opt/fpc/fpc File=/opt/fpc/fpc
  31. Hint: [TPCTargetConfigCache.NeedsUpdate] TargetOS="" TargetCPU="" Options="" compiler file changed "/usr/bin/fpc" FileAge=1625802185 StoredAge=0
  32. Hint: [TPCTargetConfigCache.NeedsUpdate] /usr/bin/fpc TargetOS= TargetCPU= CompilerOptions= ExtraOptions= PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/snap/bin
  33. Hint: (lazarus) [RunTool] "/usr/bin/fpc" "-iWTOTP"
  34. Hint: (lazarus) [RunTool] "/usr/bin/fpc" "-va" "compilertest.pas" "-Fr/usr/share/lazarus/3.0.0/components/codetools/fpc.errore.msg"
  35. Hint: [TPCTargetConfigCache.Update] has changed
  36. Hint: (lazarus) [TBuildManager.SetBuildTarget] Old=x86_64-linux-gtk2 New=x86_64-linux-gtk2 Changed: OS/CPU=True LCL=False
  37. SearchFPCSrcDirCandidates Value=/usr/share/fpcsrc/$(FPCVER) File=/usr/share/fpcsrc/3.2.2/
  38. SearchFPCSrcDirCandidates Value=/usr/share/fpcsrc File=/usr/share/fpcsrc/
  39. SearchFPCSrcDirCandidates Value=$(LazarusDir)/fpc/$(FPCVer)/source File=/usr/share/lazarus/3.0.0/fpc/3.2.2/source/
  40. SearchFPCSrcDirCandidates Value=$Path($(CompPath))/../../source File=/source/
  41. SearchFPCSrcDirCandidates Value=/usr/share/fpcsrc/$(FPCVer) File=/usr/share/fpcsrc/3.2.2/
  42. SearchFPCSrcDirCandidates Value=/usr/local/share/fpcsrc/$(FPCVer) File=/usr/local/share/fpcsrc/3.2.2/
  43. SearchFPCSrcDirCandidates Value=/usr/local/share/fpcsrc File=/usr/local/share/fpcsrc/
  44. SearchFPCSrcDirCandidates Value=/usr/fpcsrc File=/usr/fpcsrc/
  45. SearchFPCSrcDirCandidates Value=/usr/share/fpc/src File=/usr/share/fpc/src/
  46. SearchFPCSrcDirCandidates Value=/usr/fpc/src File=/usr/fpc/src/
  47. SearchFPCSrcDirCandidates Value=/usr/local/fpc/src File=/usr/local/fpc/src/
  48. SearchFPCSrcDirCandidates Value=/usr/local/share/fpc/src File=/usr/local/share/fpc/src/
  49. SearchFPCSrcDirCandidates Value=/usr/local/src/fpc File=/usr/local/src/fpc/
  50. SearchFPCSrcDirCandidates Value=/usr/lib/fpc/src File=/usr/lib/fpc/src/
  51. SearchFPCSrcDirCandidates Value=/usr/local/lib/fpc/src File=/usr/local/lib/fpc/src/
  52. SearchFPCSrcDirCandidates Value=/vol/fpc/src File=/vol/fpc/src/
  53. SearchFPCSrcDirCandidates Value=/vol/lib/fpc/src File=/vol/lib/fpc/src/
  54. SearchFPCSrcDirCandidates Value=/usr/src/fpc File=/usr/src/fpc/
  55. SearchFPCSrcDirCandidates Value=/vol/src/fpc File=/vol/src/fpc/
  56. SearchMakeExeCandidates Value=make File=/usr/bin/make
  57.  

It still cannot find "StrCtrls", or "Graphics" or "Forms". So no controls

And the datetimepicker error still occurs when building the IDE.

My distro is also based on Ubuntu 20.04 LTS

Codrut1001

  • New Member
  • *
  • Posts: 22
Re: Lazarus 3.0 on linux does not work
« Reply #5 on: November 30, 2023, 09:50:29 am »
I have figured out one issue, the apps loading slowly was caused by a missing module. This problem is a Ubuntu 20.04 one:
https://itsfoss.community/t/solved-apps-opening-too-slow-in-ubuntu-20-04/4578

This solved that issue:
Code: [Select]
sudo apt install appmenu-gtk2-module

Now with the slow lazarus app launch fixed, the missing units are the only problem left.

Why is StdCtrls, Graphichs and Forms missing? They are the most basic requirements for Lazarus
« Last Edit: November 30, 2023, 09:57:11 am by Codrut1001 »

dbannon

  • Hero Member
  • *****
  • Posts: 2750
    • tomboy-ng, a rewrite of the classic Tomboy
Re: Lazarus 3.0 on linux does not work
« Reply #6 on: November 30, 2023, 10:07:43 am »
By "app", I meant the application built by lazarus. "Project1".
OK, I am afraid then that just might be a problem in your code. Something trying to do something during shutdown ?

There is a significant difference in starting a package installed with the "lazarus" command and the ""startlazarus" command. They do different things. Startlazarus is a workaround for the fact that your package package is physically installed in read only space. Mixing the commands would cause some of the funny things you are seeing.

It still cannot find "StrCtrls", or "Graphics" or "Forms". So no controls
And the datetimepicker error still occurs when building the IDE.
And that, I am afraid is definitely a Lazarus problem.  You have installed Lazarus from the deb files on SourceForge ? (proceeding because I am almost certain you did.). There is a packaging problem with that deb file, one of the symptoms is the IDE cannot rebuild itself because it cannot find Datetimepicker. In fact, it cannot find most of its needed units, it just that it normally stops on Datetimepicker.

Your best solution by far if to use the FPC3.2.2 installed as a binary, you must have that installed already. You upstream repo has FPC3.0.4 and that will probably not do the job, you will be happier with 3.2.2 anyway.  Then build Lazarus Source, very, very simple. Remove your existing Lazarus with apt, IMPORTANT remove your existing ./lazarus config directory. I suggest 3.0 fixes, try
Code: Pascal  [Select][+][-]
  1.  $> wget https://gitlab.com/freepascal.org/lazarus/lazarus/-/archive/fixes_3_0/lazarus-fixes_3_0.zip

You will be surprised how easy it is. Its detailed at https://wiki.freepascal.org/Installing_Lazarus_on_Linux#Build_Lazarus_from_Source - do check the dependencies note, you might be OK but I am unfamiliar with your distro.

Further down that wiki page is some instructions on how to get nice icons and menu entries, more fiddly but still relatively easy.

I apologize about that buggy deb on source forge, its been reported, I spent some time trying to debug but its deep down in the Lazarus code that makes out your package installed Lazarus is actually in read/write diskspace. Its a dark place.

Don't be afraid to ask for help if you need it.

Davo

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

Codrut1001

  • New Member
  • *
  • Posts: 22
Re: Lazarus 3.0 on linux does not work
« Reply #7 on: November 30, 2023, 10:25:08 am »
By "app", I meant the application built by lazarus. "Project1".
OK, I am afraid then that just might be a problem in your code. Something trying to do something during shutdown ?

You will be surprised how easy it is. Its detailed at https://wiki.freepascal.org/Installing_Lazarus_on_Linux#Build_Lazarus_from_Source - do check the dependencies note, you might be OK but I am unfamiliar with your distro.

Further down that wiki page is some instructions on how to get nice icons and menu entries, more fiddly but still relatively easy.

I apologize about that buggy deb on source forge, its been reported, I spent some time trying to debug but its deep down in the Lazarus code that makes out your package installed Lazarus is actually in read/write diskspace. Its a dark place.

Don't be afraid to ask for help if you need it.

Davo

The slow app launch was caused by a Ubuntu bug. Installing the following module fixed It:
appmenu-gtk2-module

There could have not been a problem in my code, since I din't write any. It was a blank application

Lazarus 3 is indeed broken. I tried It in a fresh installed VM, and the problems still continued.

I will use Lazarus 2.2.6, as It appears to adress all Issues I had with 2.0.6, even the debugger one. And It can compile Itself successfully!

Thank you for all the help!

 

TinyPortal © 2005-2018