LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   Cross plat GUI framework that the final build does not need dependencies? (https://www.linuxquestions.org/questions/programming-9/cross-plat-gui-framework-that-the-final-build-does-not-need-dependencies-4175659767/)

babaliaris 08-25-2019 06:47 AM

Cross plat GUI framework that the final build does not need dependencies?
 
So, as the title clearly says, is there a GUI framework (if it's possible cross platform) which after you build your project for a specific operating system, the user won't need to install any additional depedencies.

Just run's the executable file end all works.

I know about qt and electron but both have depedencies. For example the user must have installed qt or electron in order to run the application.

I want something that after compilation will only depend on the actuall operating system API which was build for.

Of course the framework should be in c/c++ because Languages like Java or Python already have depedencies. The user must have java or python for example.

NevemTeve 08-25-2019 07:14 AM

Guess Microsoft Win32 API can be considered as such. In Unix, GUI is not part to core system, so it does require 3rd party components.

babaliaris 08-25-2019 07:38 AM

Quote:

Originally Posted by NevemTeve (Post 6029251)
In Unix, GUI is not part to core system, so it does require 3rd party components.

It doesn't even have an abstraction layer? I know that you need a 3rd party component, but those come along with the Linux distribution anyway. Unix by itself doe not provide any abstraction layer that the specific Linux distribution or the 3rd party component has to implement so other programs would be able to use system calls in order to implement GUI applications?

If not, then how do cross-platform GUI frameworks work in the first place? Are they designed to use a specific framework for example qt?

wpeckham 08-25-2019 07:46 AM

It is theoretically possible, but you are unlikely to find it pre-built. You would have to code and compile the entire project for static compilation. the result would be HUGE, as it would incorporate all libraries into the executable file. It would also be a security issue, because you could not upgrade ANY of it without re-installing or recompiling ALL of it. Bit of a nightmare scenario, actually.


If you really do want such a thing, the sources are available. You would just have to pick one and tweak the code, the configuration, and makefiles to get a complete static compile.

Why would you want this?

dugan 08-25-2019 10:55 AM

Quote:

Originally Posted by babaliaris (Post 6029241)
I know about ...and electron but both have depedencies. For example the user must have installed ..or electron in order to run the application.

Uh, that's obviously not true. Do you have to install Electron before running Slack or Visual Studio Code? No.

Anyway...

Quote:

Of course the framework should be in c/c++ because Languages like Java or Python already have depedencies. The user must have java or python for example.
On Linux, you'd pick the C/C++ framework of your choice and then make an AppImage.

babaliaris 08-26-2019 05:37 AM

Is there a way to distribute the shared libraries (of qt for example) with my app, so the client won't need to install qt??? Of course, the risk with it would be to install these shared libs on the user's computer because they might override existing files if for example he already has installed qt.

Well, I thought of a solution, so the user won't need to install them or even make changes to ld. Would it be an acceptable solution to make a script that will export all the necessary dir paths with the local .so files every time the user runs my app?

Lets say this is the structure of my app project:
--myapp(dir)
-run.sh
-app.out
-some other stuff...
--libs(dir)

and the run.sh might look something like that:
Code:

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:./libs/
./app.out

Do you think this is a fine solution? If the libs directory has all the necessary shared libraries ,doing it this way the user won't need to install anything else plus he won't have to mess with the ld directories.

Mill J 08-26-2019 09:00 AM

AppImage with LD_LIBRARY_PATH is the way to go.

I do it all the time with wxWidgets. Under Linux linking the wxWidgets library as static is relatively small and works great in an appimage.

ehartman 08-26-2019 09:06 AM

Quote:

Originally Posted by babaliaris (Post 6029583)
Do you think this is a fine solution? If the libs directory has all the necessary shared libraries ,doing it this way the user won't need to install anything else plus he won't have to mess with the ld directories.

That's one of the things "containers" (linuxcontainers.org/): distributing an application with all of its needed libraries without disturbing the host O/S.
Haven't done this myself (yet), but there many more knowledgable people on this forum who can contribute to this.

dugan 08-26-2019 11:23 AM

Quote:

Originally Posted by dugan (Post 6029288)
On Linux, you'd pick the C/C++ framework of your choice and then make an AppImage.

Quote:

Originally Posted by babaliaris (Post 6029583)
Is there a way to distribute the shared libraries (of qt for example) with my app, so the client won't need to install qt???

* cough

babaliaris 08-26-2019 01:37 PM

I will use AppImages. I just read about them and they sound incredible. Thanks for the help.


All times are GMT -5. The time now is 08:02 PM.