How to do versioning of a shared library in Linux?

前端 未结 3 439
南方客
南方客 2020-12-10 05:10

Windows provides the resource file for version information for an application and DLL. The resource file includes information like version, copyright and manufacturer.

3条回答
  •  误落风尘
    2020-12-10 05:47

    The best way to handle this is using libtool, which does the versioning for you.

    Essentially, version information is not (or not primarily, don't know from my head) encoded in the library itself, but rather in its filename. Version numbers are normally given in three-dot format, with the major number increasing for each break in downward ABI compatibility, the middle for breaks in upward ABI compatibility, and the minor for patches that did not change the ABI.

    Like qdot noted, symlinks in the lib directory provide the essential versioning. There is a symlink without a version number (libfoo.so) for the currently installed development headers, a symlink with a major number for each installed major version (libfoo.so.1) and a real file with the full version number. Normally, programs are linked to use libfoo.so.1 at runtime so that multiple major versions may coexist.

提交回复
热议问题