Creating a binary application compatible with any other Linux distribution is almost impossible, because you will never know in advance which libraries are available in the X distribution or which version of this library is available. Even among a single distribution (for example, Ubuntu), a binary application is almost never compatible with feedback, since everything built on Ubuntu 12.04 will have dependencies on the version libraries that are installed on this version of Ubuntu, and an attempt to run this binary on Ubuntu 10.04 will most likely, not simply because it does not have enough of the latest version of glibc or any other necessary library.
However, the idea can be much more effective if you limit yourself to a finite list of distributions and versions of these distributions. You can then find out which libraries are available for these distributions and aim for the lowest common denominator. I used a binary application that was supposed to support several distributions (Ubuntu, Fedora, OpenSUSE, SLED, Mandriva), and, as I would, install the oldest distribution that I aimed at my build machine. Thus, the binary application will be associated with the oldest versions of the libraries available for these distributions. If there is no new main version of such a library (which happens quite rarely, and even then distributions usually distribute the previous main version for a while for compatibility purposes), then your compiled binary will then be compatible with all your target distributions.
Therefore, a quick tip that I would give for your situation was using the oldest version of Ubuntu LTS, which is still supported (10.04 at the moment) for your development, and you should be safe enough for the latest popular distributions. For an application that you have already developed on Ubuntu 12.04, you do not have to simply recompile the same source on 10.04. Understand that you will never achieve 100% compatibility with a compiled C ++ Qt application.
If Qt is not all that important to you, you can use a higher level or interpreted language such as Python, Java, Perl, or Ruby. With these languages, you can usually rely on the implementation of a language that is already installed in the target distribution.
source share