What does 'hybrid app' exactly mean on Linux? Topic is solved

Do you have a typical platform dependent issue you're battling with ? Ask it here. Make sure you mention your platform, compiler, and wxWidgets version.
Post Reply
Dummy
Earned some good credits
Earned some good credits
Posts: 119
Joined: Tue May 10, 2005 10:29 am

What does 'hybrid app' exactly mean on Linux?

Post by Dummy » Thu Aug 01, 2019 5:38 am

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!

DavidHart
Site Admin
Site Admin
Posts: 3887
Joined: Thu Jan 12, 2006 6:23 pm
Location: IoW, UK

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

Post by DavidHart » Thu Aug 01, 2019 9:21 am

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

User avatar
doublemax
Moderator
Moderator
Posts: 14076
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

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

Post by doublemax » 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.

But i don't know how to actually implement something like this.
Use the source, Luke!

Dummy
Earned some good credits
Earned some good credits
Posts: 119
Joined: Tue May 10, 2005 10:29 am

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

Post by Dummy » Thu Aug 01, 2019 11:15 am

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?

Dummy
Earned some good credits
Earned some good credits
Posts: 119
Joined: Tue May 10, 2005 10:29 am

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

Post by Dummy » Thu Aug 01, 2019 11:38 am

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?

DavidHart
Site Admin
Site Admin
Posts: 3887
Joined: Thu Jan 12, 2006 6:23 pm
Location: IoW, UK

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

Post by DavidHart » Thu Aug 01, 2019 1:07 pm

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.

Dummy
Earned some good credits
Earned some good credits
Posts: 119
Joined: Tue May 10, 2005 10:29 am

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

Post by Dummy » Fri Aug 02, 2019 4:59 am

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!

Post Reply