Pirks Pirks - 2 years ago 127
Linux Question

How to store a version number in a static library?

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

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

Answer Source

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
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download