Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Update: Forum Guidelines & Code of Conduct


    Qt World Summit: Early-Bird Tickets

    Solved qmake generates wrong path to qrc qmlcache

    General and Desktop
    2
    7
    203
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • T
      thesourcehim last edited by

      After I installed mingw32 5.14.2 Qt I started to get strange bug in generated Makefile. My project includes a pri that has qrc file like this:
      RESOURCES += $$PWD/kbpcomponents.qrc
      In Makefile I now have this buggy line:

      Makefile: E:/projects/git/dep32/askroclient/askroclient.pro ../../../../Qt/5.14.2/mingw73_64/mkspecs/features/spec_pre.prf \
                      <skipped alot of lines>
      		E:_projects_git_dep32_qmlutils_KbpComponents_kbpcomponents_qmlcache.qrc \
      		askroclient_qmlcache.qrc
      	$(QMAKE) -o Makefile E:/projects/git/dep32/askroclient/askroclient.pro -spec win32-g++ CONFIG+=qtquickcompiler
      

      There should not be full path to qmlcache as it is located in build directory and all slashes are replaced with underscores.
      I did not have this problem with 5.13.2. Also it does not happen with linux version of 5.14.2.

      1 Reply Last reply Reply Quote 0
      • T
        thesourcehim last edited by

        Fixed
        https://bugreports.qt.io/browse/QTBUG-84901

        1 Reply Last reply Reply Quote 1
        • T
          thesourcehim last edited by

          Ok, apparently Qt version is not a problem. The problem is caused by combination of two facts:

          1. qrc file included by path, not just name, because it's not in main project directory
          2. Build directory and project directory are on different drives (build directory is on C: and source code is on E:)

          If I switch build directory to the same drive then the problem is gone. Perhaps qmake under Windows should also replace colons with underscores, not only slashes.

          1 Reply Last reply Reply Quote 0
          • SGaist
            SGaist Lifetime Qt Champion last edited by

            Hi,

            If this worked before then you may have found a regression.

            Can you reproduce that with a minimal compilable project ?

            Interested in AI ? www.idiap.ch
            Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

            1 Reply Last reply Reply Quote 0
            • T
              thesourcehim last edited by thesourcehim

              I don't believe this is a regression, I just didn't try build my project on a different drive before. qmake replaces all slashes with underscores when generating qmlcache file for a qrc because file name can not contain slashes, but it forgets that under Windows there may be also a colon in the path which should be replaced too. But the colon appears only if the build directory is on a different drive, otherwise generated path is relative and does not start with drive letter.

              1 Reply Last reply Reply Quote 0
              • SGaist
                SGaist Lifetime Qt Champion last edited by

                Good point

                In any case, it still is a bug, you should check the bug report system to see if it's something known. If not, please open a new report providing a minimal compilable example.

                Interested in AI ? www.idiap.ch
                Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                1 Reply Last reply Reply Quote 0
                • T
                  thesourcehim last edited by

                  Fixed
                  https://bugreports.qt.io/browse/QTBUG-84901

                  1 Reply Last reply Reply Quote 1
                  • SGaist
                    SGaist Lifetime Qt Champion last edited by

                    Thanks !

                    Interested in AI ? www.idiap.ch
                    Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                    1 Reply Last reply Reply Quote 0
                    • First post
                      Last post