Recent

Author Topic: Problem with Lazarus in Ubuntu Gnome  (Read 505 times)

Sashulya

  • Newbie
  • Posts: 4
Problem with Lazarus in Ubuntu Gnome
« on: September 11, 2020, 11:37:54 pm »
Hi,
I have problem using Lazarus in Ubuntu 20.04 (with Gnome). I just installed the last version of Lazarus, 2.0.10, and converted my old Delphi project. The project is very light, but the resulting executable starts with a big delay, about 20-30 seconds. And before it starts it shows warning, like "Wait" or "Force Quit".
I found no reason why it could happen, and then I installed Lazarus in another Linux - Manjaro XFCE. Everything was fine there, no matter which executable I run - compiled in Ubuntu or in Manjaro, both start very quickly, as they should.
Then I tried even in Windows, opened and compiled this project in Lazarus - and everything was fine.
It seems like this problem with big delay exists only in Ubuntu (or probably in Gnome). Could you please tell me, is it a known problem, and what can be done with it?
« Last Edit: September 13, 2020, 11:35:44 am by Sashulya »

Sashulya

  • Newbie
  • Posts: 4
Re: Problem with Lazarus in Ubuntu
« Reply #1 on: September 12, 2020, 01:31:46 am »
Surfing the internet, I found some partial solutions of this problem:

1. Compiled projects starts quickly with root privileges;

2. The problem disappears after installing appmenu-gtk2-module (sudo apt install appmenu-gtk2-module)

The second decision looks helpful, but of course I cannot distribute my application, if user's OS don't have this appmenu-gtk2-module installed. Maybe it is possible somehow to include this appmenu-gtk2-module in the project? If it is possible, could you please explain how it can be done?

Handoko

  • Hero Member
  • *****
  • Posts: 3752
  • My goal: build my own game engine using Lazarus
Re: Problem with Lazarus in Ubuntu
« Reply #2 on: September 12, 2020, 04:49:17 am »
Hello Sashulya,
Welcome to the forum.

I'm sorry to hear you have problem with Lazarus. I use Lazarus on Ubuntu Mate, so far no any serious issue.

Can you please provide any compile-able demo so we can inspect the problem? If you're not willing to publicize the project, you can write a simple demo that can show the problem.

Create a new folder, copy and paste all the necessary files into it except: the binary (exe file), *.bak, lib and backup folders. Compress the folder and send the zip here.

trev

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 927
  • Former Delphi 1-7, 10.2 User
Re: Problem with Lazarus in Ubuntu
« Reply #3 on: September 12, 2020, 05:38:17 am »
Create a new folder, copy and paste all the necessary files into it except: the binary (exe file), *.bak, lib and backup folders. Compress the folder and send the zip here.

Better yet, use the "Lazarus > Project > Publish Project" option which will create a compressed archive of the project for you.
o Lazarus v2.1.0 r63871, FPC v3.3.1 r46876, macOS 10.14.6 (with sup update), Xcode 11.3.1
o Lazarus v2.1.0 r61574, FPC v3.3.1 r42318, FreeBSD 12.1 amd64 (VMware Fusion VM)
o FPC 3.0.4, FreeBSD 12.2-STABLE r365646 amd64
o Lazarus v2.1.0 r61574, FPC v3.0.4, Ubuntu 18.04 (Parallels VM)

Handoko

  • Hero Member
  • *****
  • Posts: 3752
  • My goal: build my own game engine using Lazarus
Re: Problem with Lazarus in Ubuntu
« Reply #4 on: September 12, 2020, 08:10:41 am »
Thank you for informing us the tool.

I tried it some years ago and I've just tested it again. No, it is not 'better' as you said. For example I tested it on my CATWW project, it did not include all the necessary images. It failed on my test.

Don't get me wrong. It would be great and I appreciate the attempt of creating the tool. Unfortunately it still need need more improvements to make it really usable.

trev

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 927
  • Former Delphi 1-7, 10.2 User
Re: Problem with Lazarus in Ubuntu
« Reply #5 on: September 12, 2020, 08:24:19 am »
For example I tested it on my CATWW project, it did not include all the necessary images. It failed on my test.

Did you add your image extension to the default list: *.(pas|pp|inc|lpr|lfm|lrs|lpi|lpk|xml|sh) ?
o Lazarus v2.1.0 r63871, FPC v3.3.1 r46876, macOS 10.14.6 (with sup update), Xcode 11.3.1
o Lazarus v2.1.0 r61574, FPC v3.3.1 r42318, FreeBSD 12.1 amd64 (VMware Fusion VM)
o FPC 3.0.4, FreeBSD 12.2-STABLE r365646 amd64
o Lazarus v2.1.0 r61574, FPC v3.0.4, Ubuntu 18.04 (Parallels VM)

Handoko

  • Hero Member
  • *****
  • Posts: 3752
  • My goal: build my own game engine using Lazarus
Re: Problem with Lazarus in Ubuntu
« Reply #6 on: September 12, 2020, 08:37:33 am »
Yes, it works. Thank you.

Sashulya

  • Newbie
  • Posts: 4
Re: Problem with Lazarus in Ubuntu
« Reply #7 on: September 12, 2020, 06:11:07 pm »
Hello Sashulya,
Welcome to the forum.

I'm sorry to hear you have problem with Lazarus. I use Lazarus on Ubuntu Mate, so far no any serious issue.

Can you please provide any compile-able demo so we can inspect the problem? If you're not willing to publicize the project, you can write a simple demo that can show the problem.

Create a new folder, copy and paste all the necessary files into it except: the binary (exe file), *.bak, lib and backup folders. Compress the folder and send the zip here.

Hi,

thanks for the info and tips, I decided to investigate further and installed Ubuntu MATE, which you use. And in MATE everything is fine!

So it seems that the problem can be narrowed down: the delay after start of compiled application exists in Ubuntu Gnome only.

I just checked, MATE has this package preinstalled: appmenu-gtk2-module
And it looks like it is the sourse of the problem - this package is not installed by default in Ubuntu Gnome, but without it a compiled application has a delay while starting.

I'll try to make some simple example soon, so it can be checked by other people, and then upload here.

Handoko

  • Hero Member
  • *****
  • Posts: 3752
  • My goal: build my own game engine using Lazarus
Re: Problem with Lazarus in Ubuntu
« Reply #8 on: September 12, 2020, 06:23:29 pm »
Thank you for reporting back and sharing what you found.
This will be useful for someone with similar problem as yours in the future.

Sashulya

  • Newbie
  • Posts: 4
Re: Problem with Lazarus in Ubuntu
« Reply #9 on: September 13, 2020, 11:21:35 am »
Now I made a video to make the problem as clear as possible. As seen in video, the problem appears even with "dummy" project with single button:

https://www.youtube.com/watch?v=8NuJRA2wAFA

As we discussed, I also made a zip-archive of this project.

So, by now problem looks like this: Any project, made with the default installation of Lazarus, has a delay before starting, if the system has no appmenu-gtk2-module or some other gtk2-module installed. For example, in Ubuntu Gnome.

Seems like it depends on interface library, which by default is GTK2 in Lazarus.

Is it possible to solve this problem somehow by including some gtk2-module package in project, or do I need to use other libraries, like QT or GTK3? Thanks in advance.
« Last Edit: September 13, 2020, 10:12:59 pm by Sashulya »

 

TinyPortal © 2005-2018