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

.moc file is not included as dependency for .obj when digit separator is used

XMLWordPrintable

    • Linux/X11, macOS, Windows
    • cfcbf38f76 (qt/qtbase/dev) cfcbf38f76 (qt/tqtc-qtbase/dev)

      Building the following code gives
      fatal error C1083: Cannot open include file: 'main.moc': No such file or directory

      main.cpp

      #include <QObject>
      
      class MyObject : public QObject
      {
          Q_OBJECT;
      
          MyObject() : QObject(nullptr) {}
      };
      
      int main()
      {
          int number = 100'00;
      }
      
      #include "main.moc"
      

      The code works fine when digit separator is not used (i.e. int number = 10000; )

      Checking the generated Makefile, the reason seems main.moc is not included as a dependency for main.obj when digit separator is used.

      Sample code is attached qtbug98845.zip

        1. qtbug98845.zip
          0.7 kB
          Nahomi Gröhn
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            Eddy Edward Welbourne
            nagrohn Nahomi Gröhn (Inactive)
            Votes:
            1 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes