Qcoreapplication::applicationVersion does not "recognize" RC_FILE when using Mingw

Asked

Viewed 33 times

1

I created a file rc (Resource File) simple and added it to the project (winvertest.pro):

  • rcexample.rc

    #include "winver.h"
    
    VS_VERSION_INFO VERSIONINFO
        FILEVERSION 1,0,0,1
        PRODUCTVERSION 1,0,0,1
        FILEFLAGS 0x0L
        FILEFLAGSMASK 0x3fL
        FILEOS 0x00040004L
        FILETYPE 0x1L
        FILESUBTYPE 0x0L
    BEGIN
        BLOCK "StringFileInfo"
        BEGIN
            BLOCK "000004b0"
            BEGIN
                VALUE "CompanyName", "Foo Bar CompanyName"
                VALUE "FileDescription", "Foo bar FileDescription"
                VALUE "FileVersion", "1.0.0.1"
                VALUE "LegalCopyright", "Foo bar LegalCopyright"
                VALUE "InternalName", "foobar"
                VALUE "OriginalFilename", "foobar.exe"
                VALUE "ProductName", "foobar product name"
                VALUE "ProductVersion", "1.0.0.1"
            END
        END
        BLOCK "VarFileInfo"
        BEGIN
            VALUE "Translation", 0x0, 1200
        END
    END
    
  • winvertest.pro

    QT += core gui
    
    greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
    
    TARGET = winvertest
    TEMPLATE = app
    
    win32:RC_FILE = rcexample.rc # my rc file
    
    DEFINES += QT_DEPRECATED_WARNINGS
    
    SOURCES += main.cpp
    
  • main.cpp

    #include <QDebug>
    #include <QApplication>
    
    int main(int argc, char *argv[])
    {
        QApplication a(argc, argv);
    
        qDebug() << "applicationVersion:" << a.applicationVersion();
    
        return a.exec();
    }
    

Using MSVC2015 32bit, the applicationVersion returns:

applicationVersion: "1.0.0.1"

But when I use Mingw 5.3.0 returns empty:

applicationVersion: ""

This would be a problem with Mingw, Qt or I forgot to add something to .pro?

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.