PDA

View Full Version : Reading library version



faldzip
1st August 2009, 13:06
Hi!
As I found in Assistant, I can set the version of my library with VERSION qmake variable.
This generates resource on Windows with VS_VERSION_INFO or something like this so the version is visible in dll file properties. But is there any way to get the version of loaded library? For example: I want to dynamicaly load shared library or plugin and check the version of it. On Windows I can use some WinAPI functions to get this VS_VERSION... but is there any cross-platform way to do this? If no, then how can I do the same on Linux (don't know if the version is stored anywhere)?

caduel
1st August 2009, 14:36
setting VERSION should (on Linux) result in libs named libXXX.so.x.y.z where x.y.z comes from your VERSION

faldzip
1st August 2009, 16:02
Yes, but is this (the filename) the only place where I can find the version number? And what happend if I would have only lib*.so file in my directory?

And next thing is:
I have some library on Windows, let's say mylib (TARGET = mylib), but when I set version (VERSION = 1.2.3) then the resulting filename is: mylib1.dll. How to get the normal name (mylib.dll)? I would like this name without number, because I am already loading some plugins by name, so it will simply stop working if version changes.