File Version Information

How can I add version information to a file? Usually the files will be executable, .so and .a files.

Note. I use C ++, dpkg-build and Ubuntu 8.10 if they have support.

+1
c ++ linux version
source share
2 answers

For shared objects, pass -Wl,soname,<soname> to gcc or -soname <soname> to ld.

Executable files and static libraries do not have version information per se, but you can add it to the file name if you want.

+1
source share

There is no version information in Linux executables such as Windows ... The only way I can think of is to create a static character string that will be extended by a version control tracking system such as rcs, cvs, svn, git, in which the identifier extends based on the person who registered the code, here is an example of rcs identifiers ...

 static char * Id = "$ Id $";
 static char * Author = "$ Author $";

The above lines when checking in the version control system, they expand the next time they are checked ...

 static char * Id = "Foo, v1.1, 2009-02-18, 13:13";
 static char * Author = "foo";

And use the ' ident ' utility, which runs on binaries, 'ident' looks for Revision Control Systems ( rcs ) in binary format.

Hope this helps, Regards, Tom.

+1
source share

All Articles