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

Bo Berglund bo.berglund at gmail.com
Sun Oct 28 00:44:17 CEST 2018

On Sat, 27 Oct 2018 20:06:54 +0300, Juha Manninen via Lazarus
<lazarus at lists.lazarus-ide.org> wrote:

>On Sat, Oct 27, 2018 at 7:11 PM Bo Berglund via Lazarus
><lazarus at lists.lazarus-ide.org> wrote:
>> In the converted Delphi project I started with a .dpr file that
>> contained all active code except for two units to read Ini files mor
>> easily and to create Unix style hashed passwords. When it
>> was done it still used the dpr file as the main program source.
>I don't understand you. The converter creates a .lpr file for sure.
>On Sat, Oct 27, 2018 at 7:20 PM Bo Berglund via Lazarus
><lazarus at lists.lazarus-ide.org> wrote:
>> >If yes then use the Project Inspector, double click on the required
>> >packages to see their dependencies. Or use Package / Package graph to
>> >see the dependencies.
>> This amazingly shows:
>>   LCL
>>   IDEIntf
>>   FCL (>=1.0)
>> But I think these are for the Lazarus IDE integration of the visual components
>> and I am not using any forms or such so there is no use for this.
>It is not only for the IDE integration. There are units with GUI that need LCL.
>> Now I am at a loss as to how I can use Indy without bringing in
>> IndyLaz, just the required files. On Windows it is simple, I just set
>> the search path in Delpi to the location of the three Indy10 source
>> directories and I am done.
>You mean in Delphi it is simple.(?)
>But no, actually the global search path in Delphi can be considered a
>bug but they cannot remove it for backward compatibility.
>It pollutes the namespace also for projects that do not need a
>specific library/package.

I am talking about Delphi's project options where search path can be
entered, which are just valid for the project itself.
One can use environment variables here too to simplify the entries in
the list.

>> 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:
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

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.

But when I moved the (now skinnier executable) to the Ubuntu 18.04
machine I got the same warning once more:

(LicMgr:3198): Gtk-WARNING **: cannot open display:

So this did not cut it either...

Now I also found that I can test this easier, I just have to log out
of my development machine and stay at the login screen.
Then using PuTTY to connect to it and navigate to the project and
start the program from the command line throws the exact same error
message and the program won't run.

So it seems like someone (or maybe even me) must be logged on to the
machine console in order for it to execute this command line
Being logged on to a TightVNC session does not count...

Soooo strange!

Bo Berglund
Developer in Sweden

More information about the Lazarus mailing list