Qt - don't add major version number to end of executable / library name

How can I stop Qt from renaming my DLL to MyDLLName{MAJOR_VERSION_NUM}.dll

?

This happens when I install VERSION

in my project file, but I also want to install the version. For example, if I have:

VERSION = 1.2.3.4

      

And my library is called MyDll

, it will create my DLL in the debug folder as MyDLL1.dll

. If I pick up the version number, it will store the name as I want ( MyDLL.dll

).

Thank.

+3


source to share


2 answers


Have a look at this answer (on SO) why it exists: Why does the library name get an additional 0 in the name?

You can "not install" a version to remove it from the generated name, but are you sure you want to? (It's there to avoid DLL Hell).

The "correct answer" is that the template LIB

adds a version number.

Also note:



  • VERSION

    used to define VER_MAJ

    andVER_MIN

  • The msvc_nmake generator adds /VERSION:major.minor

    to bind flags if! empty
  • msvc_vcproj generate adds /VERSION:major.minor

    to bind flags and MSVCPROJ_VERSION

    if! empty

You can explicitly install them yourself or "disable" any of them.

You can explicitly remove the version number from the target name using a variable TARGET_EXT

, for example see http://qt-project.org/faq/answer/how_can_i_add_version_information_to_my_application

If you want to create your own plugin to decide how to create a target name (without a version number), you can create your own plugin as described in this answer (on SO): How to avoid a version number in a .so file name

+5


source


Use this:



CONFIG += skip_target_version_ext

      

+5


source







All Articles