ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I've been making applications for Windows and Mac and now it's time i start making apps for Linux. But here's the thing about Linux.. More than 1 Desktop Environment exist and so i'm wondering if the application that i will make will or will not work on all desktop environments (KDE, GNOME, Xfce etc.)
And what is the best tool to make applications for Linux? I've heard of KDevelop.. is it any good?
KDE is based on the Qt libraries; GNOME and Xfce are based on GTK+. As long as the GTK+ and/or Qt libraries exist on the system, you can use the application, whatever your desktop environment or window manager choice be.
KDE is based on the Qt libraries; GNOME and Xfce are based on GTK+. As long as the GTK+ and/or Qt libraries exist on the system, you can use the application, whatever your desktop environment or window manager choice be.
That sounds very smart Now, if some linux newbie will install Ubuntu with GNOME and he will want to run my program wich needs Qt libraries and he doesn't know how to install them, will his ubuntu automatically install Qt libraries necessery to run my application?
It's just that i'm making applications with Qt toolkit and there is this one linux newbie using Ubuntu with GNOME and he doesn't know more than duble-clicking my application to open it
I can't say for Ubuntu, but in Mandriva at least, the minimal GTK and QT packages are almost always installed, for such cases, and sometimes even the minimal Gnome and KDE packages.
And anyone not using Ubuntu or Mandriva (known to be newbie-friendly) surely knows at least how to use the package-manager.
Speaking of that, you may want to explore LSB, which should ease cross-distribution working.
Hah - unfortunately, no. You could have a "starter" script which will act as the launch point for your program: it would check to see if there is a Qt package installed - if not, install it using "apt-get" or "aptitude", then it would run your program.
Checking if Qt is installed would be a one-liner, something easy like grepping a DPKG list, or something...sorry I cannot be more specific on how to do a non-interactive command-line test for Qt's existence on a Debian-based system.
Quote:
Originally Posted by theYinYeti
Speaking of that, you may want to explore LSB, which should ease cross-distribution working.
It would, supplying the distribution is LSB-compliant. As far as I know, it's Red Hat, Fedora, Debian and OpenSuSE. Mandriva too, I think. Slackware, for instance, is not LSB-compliant.
Also keep in mind that there exist a (substantial) group of users who dislike GUIs (including me), so don't feel like you have to use these to make simple programs that do menial tasks. I know that's probably how it works in Window$.
And what is the best tool to make applications for Linux? I've heard of KDevelop.. is it any good?
Any text editor + compiler + build tool.
For text editor you can use vim, jedit, emacs, etc. - they should be available on all 3 platforms.
For build tool you can use "gnu make", "gnu build tools"("autotools"), scons (www.scons.org), or qmake (part of Qt package, only for Qt-based applications). I'd recommend to use scons or qmake. There will be a problem with autotools on windows (you'll need MSys (www.mingw.org) or cygwin to build applications that use them), and although hand-written makefiles are quite portable, they might not be flexible enough for large projects.
There are probably other build systems, like "Jam" but I never used them.
If you really want IDE available on all platforms, then there should be eclipse, netbeans (haven't used it), anjuta and codeblocks. List of all ides is available on en.wikipedia.org.
So how does Firefox (for example) get it to be cross-environment? I mean it runs on GNOME and KDE and i have never installed GTK+ or Qt... how can i make something like that??
GTK+ and Qt are probably already installed on your system given OpenSuSE usually installs both libraries anyways.
Also, Firefox is built in something called XULRunner.
As a side thought, I think it would be cool if there was a library out there that let you build a graphical application using generic classes or types, and then upon compiling, the user/administrator would decide whether they want to build it using Qt or GTK+ (or both with added -qt and -gtk suffixes?). Maybe something like this already exists...? It would cut down on a lot of re-writing and provide a nice layer/library for beginning programmers to use, in Linux, BSD and UNIX.
QueenZ - here's an example Firefox. It's running on Suse 9.3 (an admittedly old Firefox, running on an admittedly old version of Suse). As you can see from the "ldd" output (you can run the Linux command "ldd" on any executable to see what shared libraries it needs), this Firefox needs GTK runtime (and a ton of other stuff!) to work:
Back to the OP, I forgot to mention an IDE to use. Well, you can use any, but I'd recommend at least that it have syntax highlighting. I use geany, but there are plenty more to choose from: http://freshmeat.net/browse/65/
So how does Firefox (for example) get it to be cross-environment? I mean it runs on GNOME and KDE and i have never installed GTK+ or Qt... how can i make something like that??
DOn't confuse ideas. Being able to compile software on multiple platforms is not the same thing as being able to install it without additional dependencies.
Firefox needs GTK and you have it installed. If you want to distribute application without too many external dependencies, either use static linking, or include dependencies into installer, or use only commonly used libraries (probably the hardest way).
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.