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. Qt 5.4.1 : cannot find moc.exe
QtWS25 Last Chance

Qt 5.4.1 : cannot find moc.exe

Scheduled Pinned Locked Moved General and Desktop
13 Posts 4 Posters 8.9k Views
  • 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.
  • S sneubert
    20 May 2015, 13:43

    The only thing my eyes spot is the referenc to /usr/bin/sh. Of course in Win7 this leads to command not found. Are you cross-compiling for linux? A usr/bin/shshould never be in a Makefile on pure Windows qmake.

    B Offline
    B Offline
    batal1
    wrote on 20 May 2015, 14:50 last edited by
    #4

    @sneubert
    Yes, it sounds strange to me also. I'm running Qt under a Win 7 computer.
    Maybe it is because I'm using a mingw compiler ?

    1 Reply Last reply
    0
    • S sneubert
      20 May 2015, 13:43

      The only thing my eyes spot is the referenc to /usr/bin/sh. Of course in Win7 this leads to command not found. Are you cross-compiling for linux? A usr/bin/shshould never be in a Makefile on pure Windows qmake.

      B Offline
      B Offline
      batal1
      wrote on 20 May 2015, 14:56 last edited by
      #5

      @sneubert I checked again with Qt 5.4.1 (I've got both Qt 5.3.0 & Qt 5.4.1 installed on the same computer). Still have the same error

      1 Reply Last reply
      0
      • S Offline
        S Offline
        SGaist
        Lifetime Qt Champion
        wrote on 20 May 2015, 21:23 last edited by
        #6

        Hi and welcome to devnet,

        When do you have that error ?

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

        B 1 Reply Last reply 21 May 2015, 12:04
        0
        • S SGaist
          20 May 2015, 21:23

          Hi and welcome to devnet,

          When do you have that error ?

          B Offline
          B Offline
          batal1
          wrote on 21 May 2015, 12:04 last edited by
          #7

          @SGaist Hi, I get this error as soon as I use the build command.
          It started when I added a new SIGNAL/SLOT pair.
          But with the same code, it works under Qt 5.3.0 and does not under Qt 5.4.1 (but it used to)
          The difference between the 2 Qt versions is that Qt 5.4.1 uses mingw 4.9.1 instead of mingw 4.8.2
          I checked, the moc.exe file is in C:\Qt\Qt5.4.1\5.4\mingw491_32\bin\ directory ...

          1 Reply Last reply
          0
          • S Offline
            S Offline
            SGaist
            Lifetime Qt Champion
            wrote on 21 May 2015, 21:22 last edited by
            #8

            Since it used to work, what did change in between ? Did you modify the Kits ?

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

            B 1 Reply Last reply 22 May 2015, 07:14
            0
            • S SGaist
              21 May 2015, 21:22

              Since it used to work, what did change in between ? Did you modify the Kits ?

              B Offline
              B Offline
              batal1
              wrote on 22 May 2015, 07:14 last edited by
              #9

              @SGaist
              No, I don't think so.
              But I also think there has been many days between I previously ran moc.exe.
              In fact, I did not add any SIGNAL/SLOT since a very long time, so I didn't have to use the MOC
              So, maybe my configuration changed (but how ?)

              1 Reply Last reply
              0
              • S Offline
                S Offline
                SGaist
                Lifetime Qt Champion
                wrote on 22 May 2015, 21:50 last edited by
                #10

                What do you mean by "there has been many days between I previously ran moc.exe." ? Did you run it manually ?

                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
                0
                • B Offline
                  B Offline
                  batal1
                  wrote on 2 Jul 2015, 09:23 last edited by
                  #11

                  Sorry for the long delay.
                  I'm just saying that I did not have to re-run moc.exe since I did not add any SIGNAL/SLOT nor touched the UI
                  So, I just built the app using Ctrl-B

                  1 Reply Last reply
                  0
                  • S Offline
                    S Offline
                    SGaist
                    Lifetime Qt Champion
                    wrote on 2 Jul 2015, 21:34 last edited by
                    #12

                    That's the thing: you don't run moc, you re-run qmake that will in turn setup the targets to run moc when you hit the build button.

                    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
                    0
                    • A Offline
                      A Offline
                      ambershark
                      wrote on 2 Jul 2015, 23:50 last edited by
                      #13

                      The /usr/bin/sh is more than likely the issue. It looks like you used a pseudo linux environment in windows (msys/msys2/cygwin?) at some point to run the qmake and now are possibly trying to run in a pure window (cmd) environment.

                      I've done exactly that before where I had old Makefile's from when I used msys to build something, didn't clean up the build, and then tried with a pure cmd.

                      If you are in a faux-linux environment then the paths with the backslashes are the issue in finding moc as they should be c:/x/x/x/x at a minimum or in a msys /c/Qt/.../moc.exe.

                      Also I have seen issue with Qt claiming it can't find a binary when you have multiple versions of Qt installed and are mixing versions during a build. So check your pathing and QTDIR env var on that.

                      My L-GPL'd C++ Logger github.com/ambershark-mike/sharklog

                      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