Let's say I made a game like blackjack in C++ that is command line only. If I am using linux with gnome I can turn it into a graphical app using gtk3. Let's say my friend doesn't use gnome on linux. He uses freeBSD xfce or KDE, or something else entirely. My command line app will still be fine for him, but can I send the gtk3 gui app? If not would I have to make the whole thing again using qt or something else? Is there a more basic x-11 app making library that works with all of them? Sorry if this is a dumb question, I am kind of new to programming and linux in general.
>inb4 install gentoo
>inb4 remake it in haskell
Nobody?
Sorry for not shitposting about which desktop background looks the best.
>>55861176
No, the graphical library you use has nothing to do with the desktop environment. It should work as long as he uses Linux. Also BSD but you'll need to recompile.
>>55861176
>apps
If you use GTK3 it will only run on computers with compatible versions of the GTK3 libraries.
if you're running incompatible library versions but are using parts of the API that are common to both, then you can just compile against the other libraries too.
If you're switching entire OS's, then you probably should recompile. Again if you use only features common to both your versions it will compile. If the behavior changes in a way that affects your program you will have to make slightly different versions.
Same goes for QT. For what it's worth I have GTK, QT, and OpenGL installed. I can run programs that use those and were compiled against compatible libraries. Since my distro or I do the compiling that's never a problem.
Static linking might reduce the needed for library compatibility. In that case you only have to worry about how your program interfaces with the OS.
>>55861176
As someone who uses OpenBSD, let me explain. If your C++ is portable, the command line program will still work. He'll just compile it himself.
If it uses GTK3, he'll have to install the GTK3 package, so you'll have to mention that in your README file.
>Is there a more basic x-11 app making library that works with all of them?
Yes, it's called Xaw.
https://en.wikipedia.org/wiki/X_Athena_Widgets
It's what XTerm, xcalc, and xedit are made in.
>>55861476
>>55861365
Thanks guys I think that kinda clears it up. I wasn't meaning that I send him the binaries, I meant that I would send the code and he would compile it on his comp.
So in other words: if I write in in gtk3, he must have the gtk3 libraries in order to compile it. If he doesn't have those libraries it won't compile. But it doesn't matter if it's gnome, kde, whatevs as long as the gtk libraries are present?
Thanks for the tip on XAW btw, I will look into that.
>>55861561
Correct, as long as the libraries are there, he should be able to compile it and it'll run regardless of his WM (window manager) or DE (desktop environment).
Also, be prepared for people to tell you Xaw is oldfashioned, but just read up on it and you'll do fine.
Since you say you're new to programming, try programming more programs without graphics first, for practice. Maybe try Project Euler, a list of programming/math problems.
>>55861627
Not op but, thanks for not being cancer :^)
>>55861998
The cancer on /g/ usually comes from GNU fans.
>>55861998
>using the smiley with a carat nose
>>55861176
>apps
>using GTK instead of Qt
>>55865906
>using Qt instead of Xaw