如何存储在一个静态库中的版本号? [英] How to store a version number in a static library?

查看:274
本文介绍了如何存储在一个静态库中的版本号?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我怎么能存储在一个静态库(file.a)版本号,后来检查其Linux版本的?

How can I store a version number in a static library (file.a) and later check for its version in Linux?

P.S。我需要检查文件的版本,任何时候不只是利用壳公用事业任何特殊的可执行可能性。

P.S. I need possibility to check version of file any time without any special executable using only by shell utilities.

推荐答案

也许你可以创建一个字符串的版本是这样的:

Maybe you could create a string with the version like this:

char* library_version = { "Version: 1.3.6" };

,并能够从壳检查它只需使用:

and to be able to check it from the shell just use:

strings library.a | grep Version | cut -d " " -f 2

这篇关于如何存储在一个静态库中的版本号?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆