Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-58157

QLibraryInfo::location returns wrong path after running windeployqt

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Invalid
    • Icon: Not Evaluated Not Evaluated
    • None
    • 5.6.1, 5.8.0
    • None
    • Windows 10 64 bit
      MSVC2013 32 bit
      MSVC2015 32 bit

      1. Have a simple program (project attached):
        #include <QCoreApplication>
        #include <QDebug>
        #include <QDir>
        #include <QFileInfo>
        #include <QLibraryInfo>
        
        int main(int argc, char *argv[])
        {
            QCoreApplication a(argc, argv);
            const QString binPath = QLibraryInfo::location(QLibraryInfo::BinariesPath);
            qDebug() << "binPath:" << binPath;
            QFileInfo fiDebug(QDir(binPath), "Qt5Cored.dll");
            qDebug() << "contains debug binary:" << fiDebug.exists();
            QFileInfo fiRelease(QDir(binPath), "Qt5Core.dll");
            qDebug() << "contains release binary:" << fiRelease.exists();
        
            return 0;
        }
        
      2. Build this.
      3. Run it:
        D:\Testprojekte\location>debug\location.exe
        binPath: "D:/dev/32/MSVC2015/qt-5.7.1-desktop/qtbase/bin"
        contains debug binary: true
        contains release binary: true
        

        In other words, works as expected.

      4. Run windeployqt on the program:
        D:\Testprojekte\location>windeployqt debug\location.exe
        D:\Testprojekte\location\debug\location.exe 32 bit, debug executable
        Direct dependencies: Qt5Core
        All dependencies   : Qt5Core
        To be deployed     : Qt5Core
        Updating Qt5Cored.dll.
        Updating concrt140d.dll.
        Updating msvcp140d.dll.
        Updating vccorlib140d.dll.
        Updating vcruntime140d.dll.
        Patching Qt5Cored.dll...
        Creating D:\Testprojekte\location\debug\translations...
        Creating qt_ca.qm...
        Creating qt_cs.qm...
        Creating qt_de.qm...
        Creating qt_en.qm...
        Creating qt_fi.qm...
        Creating qt_fr.qm...
        Creating qt_he.qm...
        Creating qt_hu.qm...
        Creating qt_it.qm...
        Creating qt_ja.qm...
        Creating qt_ko.qm...
        Creating qt_lv.qm...
        Creating qt_pl.qm...
        Creating qt_ru.qm...
        Creating qt_sk.qm...
        Creating qt_uk.qm...
        
      5. Run the program again:
        D:\Testprojekte\location>debug\location.exe
        binPath: "D:/Testprojekte/location/debug/bin"
        contains debug binary: false
        contains release binary: false
        

        This path is obviously wrong. It should not have the "bin" subdirectory.

      With Qt 5.4.1 I could not reproduce this.

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            kleint Friedemann Kleint
            rlohning Robert Löhning
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes