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

moc can't create output file when path is longer than 255 characters

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P2: Important P2: Important
    • 6.5.0
    • 6.4
    • Build tools: moc
    • None
    • Windows
    • 501018ea3 (dev)

      Given the path "c:\Projects\C++\this is a rather long path for a path on windows where long paths are a problem with the limit of two hundred fifty characters but there is a solution which implies adding a registry key and configuring the project to include a manifest\object.h" with the content:

      #include <QObject>
      
      class A : QObject
      {
          Q_OBJECT
      public:
      };
      

      The following command works:

      $ moc object.h > object.moc.cpp
      

      I get a 2.67kB object.moc.cpp file. But the following command doesn't work:

      $ moc object.h -o object.moc.cpp
      moc: Cannot create object.moc.cpp
      

      Note that I have LongPathsEnabled set to 1 under HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem as described at https://learn.microsoft.com/en-us/windows/win32/fileio/maximum-file-path-limitation?tabs=registry

        For Gerrit Dashboard: QTBUG-109207
        # Subject Branch Project Status CR V

            fabiankosmale Fabian Kosmale
            cadam Cristian Adam
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes