[Lazarus] Built console app on Linux, but won't run on another Linux machine

classic Classic list List threaded Threaded
31 messages Options
12
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Built console app on Linux, but won't run on another Linux machine

Free Pascal - Lazarus mailing list
Bo Berglund via Lazarus <[hidden email]> schrieb am So., 28. Okt. 2018, 00:44:
>> Not so simple in Lazarus until I saw I could install indylaz.
>> Has worked fine for GUI applications so far....
>
>Yes, Indy apparently suits best for GUI apps.
>You can of course set the search path of your Lazarus project to point
>to Indy source directories.
>That is not recommended normally but this is a special case.
>If Indy Lazarus port was well designed, it would separate the GUI and
>non-GUI parts to their own packages.
>

I found the location of the indylaz package files in:
~/.lazarus1.8.4/onlinepackagemanager/packages/Indy10/
Here are the 3 dirs I need, Core, Protocols and System.

So I adding these into the Compiler/Path/OtherUnitFiles setting in
Project Options lusing the selector button
../../../.lazarus1.8.4/onlinepackagemanager/packages/Indy10/Core
../../../.lazarus1.8.4/onlinepackagemanager/packages/Indy10/System
../../../.lazarus1.8.4/onlinepackagemanager/packages/Indy10/Protocols

And I also removed the indylaz package from the project dependencies.

But when I tried to build the project it complained that it could not
find Interfaces, so I remembered that this is supplied by LCL, so I
tried adding LCL back to the project required packages.
Then the project built OK.

That something is pulling in unit Interfaces is proof that something tries to use GUI units. So either find out what unit that is (it could either be one of yours or maybe an Indy one) or try to set the LCLWidgetType to NoGUI.

Regards, 
Sven 

--
_______________________________________________
Lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Built console app on Linux, but won't run on another Linux machine

Free Pascal - Lazarus mailing list
In reply to this post by Free Pascal - Lazarus mailing list
On Sunday 28 October 2018 00:44:17 Bo Berglund via Lazarus wrote:
>
> But when I tried to build the project it complained that it could not
> find Interfaces, so I remembered that this is supplied by LCL, so I
> tried adding LCL back to the project required packages.
> Then the project built OK.

Why don't you do what I suggested in order to find out which unit pulls in the
interfaces and gtk2 dependency?

In order to get the MSEunitdep tool do:
"
git clone https://gitlab.com/mseide-msegui/mseide-msegui.git
cd mseide-msegui
fpc -Fulib/common/* -Fulib/common/kernel/linux tools/unitdep/mseunitdep.pas
"
A work of less than a minute.

Martin
--
_______________________________________________
Lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Built console app on Linux, but won't run on another Linux machine

Free Pascal - Lazarus mailing list
In reply to this post by Free Pascal - Lazarus mailing list
On 27/10/2018 14.32, Bo Berglund via Lazarus wrote:

> On Sat, 27 Oct 2018 14:03:16 +0200, "Carlos E. R. via Lazarus"
> <[hidden email]> wrote:
>
>> On 27/10/2018 13.58, Bo Berglund via Lazarus wrote:
>>
>>> I tried to upgrade, dist-upgrade the server to remove the logon
>>> greeting about available updates then rebooted.
>>> No difference.
>>>
>>> Then I tried by installing xfce4 desktop, thinking that this would
>>> deposit the X11 stuff into the system. But it did not solve the
>>> problem even though the start error message now changed to:
>>
>> IMHO, that's the wrong approach.
>>
>> You have to remove the dependency, somehow, not fulfill it.
>
> That is the problem, I don't know how to remove a dependency like
> this...
I don't know either how to find it, but installing "missing" libraries
on the server will not help, rather the contrary.


--
Cheers / Saludos,

                Carlos E. R.
                (from 42.3 x86_64 "Malachite" at Telcontar)


--
_______________________________________________
Lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus

signature.asc (188 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Built console app on Linux, but won't run on another Linux machine

Free Pascal - Lazarus mailing list
In reply to this post by Free Pascal - Lazarus mailing list
On Sun, Oct 28, 2018 at 1:50 AM Sven Barth via Lazarus
<[hidden email]> wrote:
> That something is pulling in unit Interfaces is proof that something tries to use GUI units. So either find out what unit that is (it could either be one of yours or maybe an Indy one) or try to set the LCLWidgetType to NoGUI.

NoGUI is a hack.
You should uninstall Indy from the IDE when you have its units
directly in your project. I thought it was obvious but maybe not.
Lazarus IDE gets confused when you have units from a registered
package in your project.

Martin Schreiber and others, the GTK2 dependency comes from LCL. There
is no question of it.
I just don't understand why it is so hard for Bo to remove it. Such a
simple thing to do!
I personally would just copy the needed indy units into my project
subdirectory and add them to the project. If any of those units
require LCL, the project will not compile. Simple, ha?

Bo, please report a bug for Indy project. They should divide their
package into two.

Juha
--
_______________________________________________
Lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Built console app on Linux, but won't run on another Linux machine

Free Pascal - Lazarus mailing list
On Sunday 28 October 2018 08:24:40 Juha Manninen via Lazarus wrote:

> I personally would just copy the needed indy units into my project
> subdirectory and add them to the project. If any of those units
> require LCL, the project will not compile. Simple, ha?

Or add the Indy *.ppu directory as a -Fu parameter without using Indy
packages?
https://mseide-msegui.sourceforge.io/pics/indypath.png

Martin
--
_______________________________________________
Lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Built console app on Linux, but won't run on another Linux machine

Free Pascal - Lazarus mailing list
In reply to this post by Free Pascal - Lazarus mailing list
On Sun, 28 Oct 2018 00:49:50 +0200, Sven Barth via Lazarus
<[hidden email]> wrote:

>That something is pulling in unit Interfaces is proof that something tries
>to use GUI units. So either find out what unit that is (it could either be
>one of yours or maybe an Indy one) or try to set the LCLWidgetType to NoGUI.
>

SVEN, THANK YOU VERY MUCH!!!
-----------------------------
This was a project option I did not know about before and then not how
to set it.
But after a bit of google use I found the way:

- open Project/ProjectOptions/CompilerOptions/AdditionsAndOverrides

- In this dialogue there is a dropdown above the listbox named:
  Set "LCLWidgetType" drop it down and find the entry
  "Value nogui"
  and select it

- OK to the main window and select Run/Build

This will rebuild the indylaz package and then the main application,
which now starts OK also with noone logged on to the main window.

It still needs the Interfaces entry under uses, though!
But if I comment it out then it is not discovered until linking the
application....

I always thought that options like these could be set in similar ways
as the {$mode objfpc}{$H+} in the main project file.
Maybe it is also possible? If so what is the correct syntax?
I would like to have it visible in the source if ever possible.


--
Bo Berglund
Developer in Sweden

--
_______________________________________________
Lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Built console app on Linux, but won't run on another Linux machine

Free Pascal - Lazarus mailing list


On Sun, 28 Oct 2018, Bo Berglund via Lazarus wrote:

> On Sun, 28 Oct 2018 00:49:50 +0200, Sven Barth via Lazarus
> <[hidden email]> wrote:
>
>> That something is pulling in unit Interfaces is proof that something tries
>> to use GUI units. So either find out what unit that is (it could either be
>> one of yours or maybe an Indy one) or try to set the LCLWidgetType to NoGUI.
>>
>
> SVEN, THANK YOU VERY MUCH!!!
> -----------------------------
> This was a project option I did not know about before and then not how
> to set it.

To be fair:

Mattias suggested this already earlier in the thread than Sven. It was one
of the first replies.

Michael.
--
_______________________________________________
Lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Built console app on Linux, but won't run on another Linux machine

Free Pascal - Lazarus mailing list
Michael Van Canneyt via Lazarus <[hidden email]> schrieb am So., 28. Okt. 2018, 11:41:


On Sun, 28 Oct 2018, Bo Berglund via Lazarus wrote:

> On Sun, 28 Oct 2018 00:49:50 +0200, Sven Barth via Lazarus
> <[hidden email]> wrote:
>
>> That something is pulling in unit Interfaces is proof that something tries
>> to use GUI units. So either find out what unit that is (it could either be
>> one of yours or maybe an Indy one) or try to set the LCLWidgetType to NoGUI.
>>
>
> SVEN, THANK YOU VERY MUCH!!!
> -----------------------------
> This was a project option I did not know about before and then not how
> to set it.

To be fair:

Mattias suggested this already earlier in the thread than Sven. It was one
of the first replies.

Indeed. And in another mail I had written as well that Mattias had suggested that already. 

Regards, 
Sven 

--
_______________________________________________
Lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Built console app on Linux, but won't run on another Linux machine

Free Pascal - Lazarus mailing list
In reply to this post by Free Pascal - Lazarus mailing list
On Sun, 28 Oct 2018 11:41:51 +0100 (CET), Michael Van Canneyt via
Lazarus <[hidden email]> wrote:

>
>
>On Sun, 28 Oct 2018, Bo Berglund via Lazarus wrote:
>
>> On Sun, 28 Oct 2018 00:49:50 +0200, Sven Barth via Lazarus
>> <[hidden email]> wrote:
>>
>>> That something is pulling in unit Interfaces is proof that something tries
>>> to use GUI units. So either find out what unit that is (it could either be
>>> one of yours or maybe an Indy one) or try to set the LCLWidgetType to NoGUI.
>>>
>>
>> SVEN, THANK YOU VERY MUCH!!!
>> -----------------------------
>> This was a project option I did not know about before and then not how
>> to set it.
>
>To be fair:
>
>Mattias suggested this already earlier in the thread than Sven. It was one
>of the first replies.

You are right! But at the time I was trailing in another direction and
I also did not know how to acctually effect it....
Thanks to Mattias also, of course!

I have been using Lazarus/FPC for a few years on RaspberryPi units and
there I have also programmed utilities that run as command line
programs and I had no problem with these. So I was stunned by this
happening and really suspected something else entirely....
Of course these utilities were used on the RPi itself. But I was
always connecting to the RPi using TightVNC or later RealVNC.
I have never really had a monitor attached to any of my RPi units.


--
Bo Berglund
Developer in Sweden

--
_______________________________________________
Lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Built console app on Linux, but won't run on another Linux machine

Free Pascal - Lazarus mailing list
In reply to this post by Free Pascal - Lazarus mailing list
On Sun, 28 Oct 2018 09:24:40 +0200, Juha Manninen via Lazarus
<[hidden email]> wrote:

>I personally would just copy the needed indy units into my project
>subdirectory and add them to the project. If any of those units
>require LCL, the project will not compile. Simple, ha?

Well, years ago I tried that with Delphi, but it turned out that the
units needed expanded from the first one since they are interdependent
so in the end I used environment variables to direct the Delphi
compiler to the correct Indy10 dirs where all files were collected.
Different IDE paradigm of course....


--
Bo Berglund
Developer in Sweden

--
_______________________________________________
Lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Built console app on Linux, but won't run on another Linux machine

Free Pascal - Lazarus mailing list
On Sunday 28 October 2018 17:25:45 Bo Berglund via Lazarus wrote:

> On Sun, 28 Oct 2018 09:24:40 +0200, Juha Manninen via Lazarus
>>I personally would just copy the needed indy units into my project
>>subdirectory and add them to the project. If any of those units
>>require LCL, the project will not compile. Simple, ha?
>
> Well, years ago I tried that with Delphi, but it turned out that the
> units needed expanded from the first one since they are interdependent
> so in the end I used environment variables to direct the Delphi
> compiler to the correct Indy10 dirs where all files were collected.
> Different IDE paradigm of course....
>
As Juha writes, using NoGUI is a hack. You should find out which units pull in
LCL and remove them. Different ways how to find out which units are affected
already have been described in this thread, please read again.

Martin
--
_______________________________________________
Lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
12