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

qmake generates wrong relative depedency paths to qt includes

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • 6.7.2
    • Build tools: qmake
    • None
    • Windows 11
    • Windows

    Description

      The attached project qtabl2.zip is a most simple test project, created with QtCreator in directory C:\Projects\qtabl2 (see Project_root.png).
      Qt 6.7.2 is installed in the default directory C:\Qt (see InstallDir.png).

      When I run qmake (either from creator: QMake_Creator.png or command line: QMake_CmdLine.png, qmakeV.log), the resulting Makefile.Debug (see zip) contains such entries:

      debug\moc_mainwindow.cpp: ..\..\mainwindow.h \
              ..\..\..\..\..\..\Qt\6.7.2\msvc2019_64\include\QtWidgets\QMainWindow \
              ..\..\..\..\..\..\Qt\6.7.2\msvc2019_64\include\QtWidgets\qmainwindow.h \
              ..\..\..\..\..\..\Qt\6.7.2\msvc2019_64\include\QtWidgets\qtwidgetsglobal.h \
              ..\..\..\..\..\..\Qt\6.7.2\msvc2019_64\include\QtGui\qtguiglobal.h \

      The path to the Qt-Includes is wrong (2 ".." too much). Correct would be 
              ..\..\..\..\Qt\6.7.2\msvc2019_64\include\QtWidgets\QMainWindow \
              or
              C:\Qt\6.7.2\msvc2019_64\include\QtWidgets\QMainWindow \

      Therefore, when trying to compile I get this error message: 
      :-1: Fehler: dependent '..\..\..\..\..\..\Qt\6.7.2\msvc2019_64\include\QtWidgets\QMainWindow' does not exist.
      as seen in ErrorMessage_Creator.png and CompileOutput.png

      Manually editing Makefile.Debug is a workaround.
      For unknown reason, I observed this problem only on some PCs (but there 100% reproducable).

      Attachments

        1. ErrorMessage_Creator.png
          93 kB
          Daniel Frey
        2. InstallDir.png
          99 kB
          Daniel Frey
        3. Project_root.png
          52 kB
          Daniel Frey
        4. QMake_CmdLine.png
          66 kB
          Daniel Frey
        5. QMake_Creator.png
          122 kB
          Daniel Frey
        6. CompileOutput.png
          332 kB
          Daniel Frey
        7. qmakeV.log
          3.88 MB
          Daniel Frey
        8. qtabl2.zip
          2.40 MB
          Daniel Frey
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            qtbuildsystem Qt Build System Team
            daniel_frey Daniel Frey
            Votes:
            3 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes