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. CompileOutput.png
          CompileOutput.png
          332 kB
        2. ErrorMessage_Creator.png
          ErrorMessage_Creator.png
          93 kB
        3. InstallDir.png
          InstallDir.png
          99 kB
        4. Project_root.png
          Project_root.png
          52 kB
        5. QMake_CmdLine.png
          QMake_CmdLine.png
          66 kB
        6. QMake_Creator.png
          QMake_Creator.png
          122 kB
        7. qmakeV.log
          3.88 MB
        8. qtabl2.zip
          2.40 MB
        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