How to store a version number in a static library?

后端 未结 5 1657
一整个雨季
一整个雨季 2021-01-02 16:47

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 wit

5条回答
  •  囚心锁ツ
    2021-01-02 17:05

    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
    

提交回复
热议问题