PDA

View Full Version : How to find out the earliest compatible version of a library?



jamadagni
23rd August 2006, 02:06
Hello.

If I create a Qt-based program, and I package it for Linux, I need to indicate the dependencies. Obviously, it would not be a good idea to ask my users to upgrade to the latest versions of dependencies unnecessarily. So how do I find out what is the earliest version of a dependency that will support my app correctly? Is trial and error the only way?

Thanks.

Brandybuck
23rd August 2006, 06:47
Obviously, it would not be a good idea to ask my users to upgrade to the latest versions of dependencies unnecessarily.
Why should you be any different from Redhat? :D :D :D :D


So how do I find out what is the earliest version of a dependency that will support my app correctly? Is trial and error the only way?
The general rule of thumb is that libraries should be backwardly compatible within their minor version. For example, A program written with qt-4.1.4 should work fine with qt-4.1.0. Libraries should also be "forward" compatible within their major version. A program written with qt-4.0.0 should work with qt-4.2.0.

But the Open Source world is a very undisciplined place, and many libraries do not follow these rules. GNU is one of the worst offenders, despite being the author of some very good guidelines on the subject (look in the libtool docs for it).

A good testing methodology is to keep some older live CDs around, and test your binary with those.

wysota
29th August 2006, 02:01
When it comes to Qt, if a new method comes in, it is always marked in the docs along with the minor number (or release, if it happened so) where it was introduced. You can track the version number you need this way.

Another way is to try your app with a low-numbered version and if it fails, try a higher-numbered one until you get a running app.

Of course one thing is binary compatibility and another is proper functoning of the application. Some apps won't work with particular versions because they use a code which contains bugs in that particular (and probably also earlier) version of the library.

So the best way is just to know which version will work fine and why, based on your own experience while writing the code.