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

qmake fails to generate moc_*.cpp files on windows if project path contains white spaces when include directives are more than 40

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • 5.9.2
    • 5.5.1, 5.7.1, 5.8.0, 5.9.1
    • None
    • Windows 7 (any windows?)

      Tested with MSVC2015 x64 (but I think that it is independent from compiler type or version)
    • 342609b542a4c9c50f40b5843e0622ca3f401da0

    Description

      When the following conditions are both met:

      • Project path contains white-spaces (for example C:\User Data\workspace\MyProject)
      • Include directives are more than 40

      Build fails when invoking moc.exe with the following error:

      moc: Cannot open options file specified with @
      
      NMAKE : fatal error U1077: 'C:\Qt\5.9.1\msvc2015_64\bin\moc.exe' : return code '0x1'
      

      This is due to qmake generating an invalid command for any moc cpp that has to be generated, for example:

      C:\Qt\5.9.1\msvc2015_64\bin\moc.exe $(DEFINES) --compiler-flavor=msvc --include "C:\User Data\workspace\MyProject\moc_predefs.h" @C:\User Data\workspace\MyProject\mocinclude.opt MyQObject.h -o moc_MyQObject.cpp
      

      In this extract from my Makefile, the mocinclude.opt file (which is generated by qmake) is passed to moc.exe without quotes, generating the error above.

      Attachments

        Activity

          People

            jbornema Joerg Bornemann
            paolo Paolo Bernini
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: