Page 1 of 1

What does 'hybrid app' exactly mean on Linux?

Posted: Thu Aug 01, 2019 5:38 am
by Dummy
Hello everyone!

In the wxWidgets documentation of wxAppConsole is written:
This class is essential for writing console-only or hybrid apps without having to define wxUSE_GUI=0.

There is also an interesting post in this forum: Combined GUI console app

But what does 'hybrid app' exactly mean on Linux?

Can such a hybrid app also be used on a pure console variant of Linux, without an installed desktop system?

Or is an installed desktop system necessary for it?
Meaning that it can only be used on a Linux desktop, but there with GUI or inside a console window without it.

What is required to build an app, that can be used also on a pure console variant of Linux?
Can only pure console apps be used there?

Is it nessecary to build wxWidgets with defined wxUSE_GUI=0, to be able to build a pure console app?
In that case it would be necessary to build two different configured wxWidgets versions, right?
One for GUI apps and one (with wxUSE_GUI=0) for pure console apps.

I hope you can help me for a better understanding.
Thank you in advance!

Re: What does 'hybrid app' exactly mean on Linux?

Posted: Thu Aug 01, 2019 9:21 am
by DavidHart
Hi,

To start with the easy one:
Is it necessary to build wxWidgets with defined wxUSE_GUI=0, to be able to build a pure console app?
No. You can easily test that yourself in a GUI wx build: the 'console' sample runs normally, just as it would in a wxUSE_GUI=0 build.
But what does 'hybrid app' exactly mean on Linux?
I've not previously heard the expression, but afaik it doesn't signify anything on Linux that's different to the meaning used in that thread.

As for the rest of your questions: you presumably have easy access to your target pure console variant, so I suggest you try things there to see what works.

Regards,

David

Re: What does 'hybrid app' exactly mean on Linux?

Posted: Thu Aug 01, 2019 10:15 am
by doublemax
Can such a hybrid app also be used on a pure console variant of Linux, without an installed desktop system?
I think that's what it means. An app that can run in console mode without X or GTK, but can also display a GUI when a desktop is present.

But i don't know how to actually implement something like this.

Re: What does 'hybrid app' exactly mean on Linux?

Posted: Thu Aug 01, 2019 11:15 am
by Dummy
Hello David and doublemax,

Thanks for your replies!
doublemax wrote: Thu Aug 01, 2019 10:15 am
Can such a hybrid app also be used on a pure console variant of Linux, without an installed desktop system?
I think that's what it means. An app that can run in console mode without X or GTK, but can also display a GUI when a desktop is present.
I had interpreted that in this way, too.

But the hybrid app I have build for testing does not run on a system without any desktop.
When starting the application, the following error message appears.
error while loading shared libraries: libXxf86vm.so.1: cannot open shared object file: No such file or directory
On a desktop system, the hybrid app can be used as expected, with GUI or inside a console window without it.

I also tried to test with the wx console sample, but got same result.
But maybe I am doing something wrong.
What is the correct way to build the console sample?

Re: What does 'hybrid app' exactly mean on Linux?

Posted: Thu Aug 01, 2019 11:38 am
by Dummy
The wx console sample works now also on a system without desktop!

I had build it using a modified codeblocks project.
When building the sample using the makefile in the build directory of wxWidgets, it works.

But what does that mean to my hybrid app problem?
Any ideas?

Re: What does 'hybrid app' exactly mean on Linux?

Posted: Thu Aug 01, 2019 1:07 pm
by DavidHart
libXxf86vm googles to "X11 XFree86 video mode extension library" so it's not too surprising it's not installed on your pure console target. That will probably be one of many missing dependencies (ldd will tell you more).

That may not be a problem: to have a reasonable hope of creating a single binary that will run on both, they must both have the same distro/version installed. So you create a package suitable for that type of distro (deb, rpm etc), adding libXxf86vm (and the other dependency packages) to the list of 'Depends'/'Requires'/whatever. The pure console target should be able to install such libs even if it doesn't otherwise use them.

If you control your two target machines, you wouldn't even need to create a package: just build the binary on one machine and run it on both, installing by hand any dependencies.

If the above works, so you have a program that will run in console mode on both types of machine, the next step would be to try adding an optional gui, as in that old thread. You could auto-detect the presence of a gui, but the easier way would be to pass a '--with-gui' option when running the program.

Re: What does 'hybrid app' exactly mean on Linux?

Posted: Fri Aug 02, 2019 4:59 am
by Dummy
My hope was that such GUI libraries would not be loaded if not needed in console mode.

Since this is not the case, it is probably a better and more proper solution to build two separate apps.
A GUI app with all features and a console app containing only features that can be used in a console.

Many thanks for your help!