Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. No rule to make target 'debug/file.moc'
Qt 6.11 is out! See what's new in the release blog

No rule to make target 'debug/file.moc'

Scheduled Pinned Locked Moved Solved General and Desktop
7 Posts 3 Posters 3.8k Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    AndrzejB
    wrote on last edited by
    #1

    error:
    No rule to make target 'debug/codeeditor.moc', needed by 'debug/codeeditor.o'. Stop.
    error after:
    adding namespaces and moving CodeEditorSidebar from common file to own file.

    https://gist.github.com/borneq/e1fab5778648fee5099b7ce16abccc7e

    1 Reply Last reply
    0
    • mrjjM Offline
      mrjjM Offline
      mrjj
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi
      Did you try to delete the build directory ?
      Those errors sometimes comes from cached qmake files.
      alt text

      1 Reply Last reply
      0
      • A Offline
        A Offline
        AndrzejB
        wrote on last edited by
        #3

        Yes, I delete build directory and *.user file.

        mrjjM 1 Reply Last reply
        0
        • A AndrzejB

          Yes, I delete build directory and *.user file.

          mrjjM Offline
          mrjjM Offline
          mrjj
          Lifetime Qt Champion
          wrote on last edited by
          #4

          @AndrzejB
          Ok , then its a bit odd then.
          Check .pro file you do have included the codeeditor.h
          like
          HEADERS += codeeditor.h

          1 Reply Last reply
          0
          • A Offline
            A Offline
            AndrzejB
            wrote on last edited by AndrzejB
            #5

            I return to correct version on git and then only moved CodeEditorSidebar to own file, and have erorrs:
            D:\wazne\github_my\qteditor_tmp\build-qedytor-Desktop_Qt_5_12_0_MinGW_64_bit-Debug\debug\moc_codeeditorsidebar.cpp:58: error: multiple definition of `CodeEditorSidebar::qt_static_metacall(QObject*, QMetaObject::Call, int, void**)'

            D:\wazne\github_my\qteditor_tmp\build-qedytor-Desktop_Qt_5_12_0_MinGW_64_bit-Debug\debug\moc_codeeditorsidebar.cpp:76: error: multiple definition of `CodeEditorSidebar::metaObject() const'

            ....
            BUT after deleting build direcotory still error: :-1: błąd: No rule to make target 'debug/codeeditor.moc', needed by 'debug/codeeditor.o'. Stop.

            Previous was a bit odd: both class declaration and methods definitions was in *.cpp file. If I move class declaration to *.h is error

            Both classes are mutual dependend.

            1 Reply Last reply
            0
            • SGaistS Offline
              SGaistS Offline
              SGaist
              Lifetime Qt Champion
              wrote on last edited by
              #6

              Hi,

              Remove #include "codeeditor.moc" from codeditor.cpp. You don't need it since you have now each class in their own header file.

              Interested in AI ? www.idiap.ch
              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

              1 Reply Last reply
              3
              • A Offline
                A Offline
                AndrzejB
                wrote on last edited by
                #7

                Thanks, is OK now.

                1 Reply Last reply
                0

                • Login

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • Users
                • Groups
                • Search
                • Get Qt Extensions
                • Unsolved