Modern Unix systems follow a versioning scheme for libraries. The version number of a library and the version numbers of libraries on which it depends, are encoded in the library. Also the version number is in some way reflected in its name. The GnuWin dynamic libraries (DLL's) follow a similar versioning scheme.
First, the version number is encoded in the library by adding
a resource file to it. You can see the version number by right-clicking
on the DLL, choosing Properties and then Version.
The version number is at the top this tab page as well as in the
list of properties below. This version number is the one from the
package, and it may consist of 4 parts: the major
number, the minor number, the build number, and
the revision number; the revision number is sometimes
called the QFE (Quick Fix Engineering) number. If one or more of
these subnumbers are omitted in the official package version
number, then for the GnuWin library they have been added in the
following way: the first empty subnumber is set equal to the
number of days elapsed between the day the binary has been
created and 1 January 2000, and the next empty one is set equal
to the number of seconds elapsed since the start of the day on
which the binary was created, divided by 2; both are computed
with reference to Universal Coordinated Time (GMT). This practice
is copied from
.NET practice, although there the numbers are computed with
reference to local time. In fact, any GnuWin binary has this
version number encoded.
A program can retrieve the version number by calling the Win32 API function GetFileVersionInfo. Alternatively, DLL's newer than 1 February 2004, support a function DllGetVersion, similar to the Microsoft shell libraries. DllGetVersion is simpler to use than GetFileVersionInfo. See also the example programs:
The major and minor version numbers are also encoded as the major and minor image version numbers in the header of the libraries and executables. They are in bytes 44 - 47 after the PE signature, which is usually in bytes 0x80 - 0x83, so that the version numbers usually are in bytes 0xC3 - 0xC6; see the PE-Coff specification for more details. These two version numbers can be retrieved with the help of the ImageHelp library functions, in particular GetImageConfigInformation.
Second, a number is attached to the name of the DLL that reflects its LibTool interface version number. The interface of a library is the set of global variables and global functions it exports. It is described by three integers:
The LibTool version number is usually given in the form current:revision:age. This means that:
The GnuWin DLL's follow the Cygwin practice of adding current - age to the name of the DLL. This number is equal to the oldest interface that is still compatible with the latest interface. Usually the LibTool version info is directly set in the Makefile of the library. If no LibTool version info is available, then it is assumed that
so that in effect the major number of the package will be added to the name of the library. If current is equal to age, then the version number would be zero, but then it is usually omitted.
You can see the complete LibTool version number by right-clicking on the DLL, choosing Properties and then Version. The LibTool version number is in the box with the list of properties. A program can retrieve this version number by calling the Win32 API function GetFileVersionInfo.