PDA

View Full Version : how to get qmake to stop adding version numbers to my target DLL filename



cboles
29th July 2008, 08:13
When making a DLL, qmake seems to take the major number of the VERSION parameter and add it to the TARGET name, so that what starts as:

TARGET = mytarget
VERSION = 1.0.0
...

becomes

mytarget1.dll

How can I disable this behavior, but still keep the file version feature? If I remove the version parameter, the file naming problem goes away, but so do the file versions.

Colby

ComaWhite
29th July 2008, 12:29
Yeah I had this problem to. The only way I found out was to switch to cmake.

wysota
29th July 2008, 13:24
Remove the VERSION variable and store the version in the library using regular means (there is a call in WinAPI to do that).

cboles
29th July 2008, 17:32
Thanks for the replies. Like I mentioned before, if I remove the VERSION parameter, the problem goes away, but I lose the version number which can be seen in the file properties. This numbering is not part of any WinAPI - it's just static metadata in the file.

I did notice the following two parameters in the docs which sounded promising, but setting them didn't seem to change the results. I wonder - is the lib template for qmake hard-coded, or is it defined in a file somewhere?

TARGET_x
This variable specifies the target's extension with a major version number. The value of this variable is typically handled by qmake or qmake.conf and rarely needs to be modified.

TARGET_x.y.z
This variable specifies the target's extension with version number. The value of this variable is typically handled by qmake or qmake.conf and rarely needs to be modified.

wysota
29th July 2008, 19:35
Thanks for the replies. Like I mentioned before, if I remove the VERSION parameter, the problem goes away, but I lose the version number which can be seen in the file properties. This numbering is not part of any WinAPI - it's just static metadata in the file.

Bla bla bla :)

Add this to any of your implementation files:

EXPORT_SIGNATURE(1,0,0,0)

where:

#define EXPORT_SIGNATURE(a,b,c,d) \
int __getSignature__() \
{\
return (a << 24 | b << 16 | c << 8 | d);\
}

cboles
30th July 2008, 22:37
Adding the code above didn't seem to do anything for the file version info when I right-click the properties of my DLL. I would be really surprised if Windows would execute a function such as getSignature in the DLL to get the file version info - that would be a great way to execute malicious code. I can't seem to find anything regarding getSignature on the web either.

egawa
11th September 2012, 21:45
add this to your .pro file:


TARGET_EXT = .dll

http://qt-project.org/faq/answer/how_can_i_add_version_information_to_my_applicatio n

ChrisW67
12th September 2012, 06:42
You can install the version information resources, the stuff you see in Windows Explorer, along with your program icon etc. using a standard Windows RC file VERSIONINFO (http://msdn.microsoft.com/en-us/library/windows/desktop/aa381058%28v=vs.85%29.aspx)

There are even examples in these forums: http://www.qtcentre.org/threads/47693