Results 1 to 8 of 8

Thread: how to get qmake to stop adding version numbers to my target DLL filename

  1. #1
    Join Date
    Mar 2006
    Posts
    46
    Thanks
    8
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default how to get qmake to stop adding version numbers to my target DLL filename

    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

  2. #2
    Join Date
    Mar 2008
    Location
    Houston, Texas, USA
    Posts
    277
    Thanks
    9
    Thanked 17 Times in 17 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Maemo/MeeGo

    Default Re: how to get qmake to stop adding version numbers to my target DLL filename

    Yeah I had this problem to. The only way I found out was to switch to cmake.
    Qt-4.7.3 | Gentoo ~amd64 | KDE-4.7
    Aki IRC Client for KDE4 | Qt Documentation

  3. #3
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: how to get qmake to stop adding version numbers to my target DLL filename

    Remove the VERSION variable and store the version in the library using regular means (there is a call in WinAPI to do that).

  4. #4
    Join Date
    Mar 2006
    Posts
    46
    Thanks
    8
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: how to get qmake to stop adding version numbers to my target DLL filename

    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.

  5. #5
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: how to get qmake to stop adding version numbers to my target DLL filename

    Quote Originally Posted by cboles View Post
    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:
    Qt Code:
    1. EXPORT_SIGNATURE(1,0,0,0)
    To copy to clipboard, switch view to plain text mode 

    where:
    Qt Code:
    1. #define EXPORT_SIGNATURE(a,b,c,d) \
    2. int __getSignature__() \
    3. {\
    4. return (a << 24 | b << 16 | c << 8 | d);\
    5. }
    To copy to clipboard, switch view to plain text mode 

  6. #6
    Join Date
    Mar 2006
    Posts
    46
    Thanks
    8
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: how to get qmake to stop adding version numbers to my target DLL filename

    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.

  7. #7
    Join Date
    Sep 2012
    Posts
    1

    Default Re: how to get qmake to stop adding version numbers to my target DLL filename

    add this to your .pro file:

    Qt Code:
    1. TARGET_EXT = .dll
    To copy to clipboard, switch view to plain text mode 

    http://qt-project.org/faq/answer/how...my_application

  8. #8
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: how to get qmake to stop adding version numbers to my target DLL filename

    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

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

Similar Threads

  1. Qt designer plugin errors on OSX Leopard
    By mpotocnik in forum Qt Tools
    Replies: 10
    Last Post: 21st January 2008, 09:45
  2. Distributing QT application for Mac OS
    By mb0 in forum Qt Programming
    Replies: 1
    Last Post: 31st May 2007, 18:59
  3. Replies: 15
    Last Post: 21st April 2007, 17:46
  4. how to corss compile for windows in Linux
    By safknw in forum Qt Programming
    Replies: 24
    Last Post: 13th May 2006, 05:23

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.