libtool动态库版本系统之个人理解

libtool动态库版本由current:revision:age组成,分别对应接口改动次数、源码修改次数(不改接口)和向前兼容版本数。当接口变动,current和revision更新;仅增加接口,age增加。动态库在编译后产生多个版本,如libraryname.so.2.1.12。若程序依赖高版本接口但在仅安装低版本库的机器上运行,会导致运行时未定义的符号错误,需确保运行环境有相同主版本号的最新库。
摘要由CSDN通过智能技术生成

 

首先看下libtool官方对library版本系统的说明。

 

7.3 Updating library version information
If you want to use libtool's versioning system, then you must specify the version information to libtool using the -version-info flag during link mode (see Link mode). 

This flag accepts an argument of the form ‘current[:revision[:age]]’. So, passing -version-info 3:12:1 sets current to 3, revision to 12, and age to 1. 

If either revision or age are omitted, they default to 0. Also note that age must be less than or equal to the current interface number. 

Here are a set of rules to help you update your library version information: 

Start with version information of ‘0:0:0’ for each libtool library. 
Update the version information only immediately before a public release of your software. More frequent updates are unnecessary, and only gu
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值