Results 1 to 5 of 5

Thread: moc.exe is not recognized as an internal or external command

  1. #1
    Join Date
    Jan 2010
    Posts
    7
    Qt products
    Qt4
    Platforms
    Windows

    Exclamation moc.exe is not recognized as an internal or external command

    Hi everyone,
    I am getting this error after trying to configure for a static build.
    When relaunching the Qt Creator and trying to do a simple build on existing project I am getting this error messages:



    Starting: c:/qt/2010.01/qt/bin/qmake.exe C:/Qt/2010.01/qt/examples/animation/appchooser/appchooser.pro -r CONFIG+=debug_and_release -spec ..\..\..\mkspecs\win32-g++
    Exited with code 0.
    Starting: C:/Qt/2010.01/mingw/bin/mingw32-make.exe debug -w
    mingw32-make: Entering directory `C:/Qt/2010.01/qt/examples/animation/appchooser'
    C:/Qt/2010.01/mingw/bin/mingw32-make -f Makefile.Debug
    mingw32-make[1]: Entering directory `C:/Qt/2010.01/qt/examples/animation/appchooser'
    C:/Qt/2010.01/qt/bin/moc.exe -DUNICODE -DQT_LARGEFILE_SUPPORT -DQT_GUI_LIB -DQT_CORE_LIB -DQT_THREAD_SUPPORT -DQT_NEEDS_QMAIN -I"..\..\..\include\QtCore" -I"..\..\..\include\QtGui" -I"..\..\..\include" -I"..\..\..\include\ActiveQt" -I"tmp\moc\debug_static" -I"..\..\..\mkspecs\win32-g++" -D__GNUC__ -DWIN32 main.cpp -o tmp\moc\debug_static\main.moc
    mingw32-make[1]: Leaving directory `C:/Qt/2010.01/qt/examples/animation/appchooser'
    mingw32-make: Leaving directory `C:/Qt/2010.01/qt/examples/animation/appchooser'
    'C:/Qt/2010.01/qt/bin/moc.exe' is not recognized as an internal or external command,
    operable program or batch file.
    mingw32-make[1]: *** [tmp/moc/debug_static/main.moc] Error 1
    mingw32-make: *** [debug] Error 2
    Exited with code 2.
    Error while building project appchooser
    When executing build step 'Make'


    I did some searching and still couldn't find out what the problem is and how to go about solving this issue.

    Any help will be greatly appreciated.

    Thank You,
    -Deshi

  2. #2
    Join Date
    Sep 2009
    Location
    UK
    Posts
    2,447
    Thanks
    6
    Thanked 348 Times in 333 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: moc.exe is not recognized as an internal or external command

    It seems you have an installation problem, as Qt should be where its looking. Try reinstalling Qt.

  3. #3
    Join Date
    Jan 2010
    Posts
    7
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: moc.exe is not recognized as an internal or external command

    Thanks for your reply.

    I know that fresh install works. This problem comes after trying to deploy my app in static mode without any dependices of dll files.

    I read the tutorial which said to use this command

    configure -static

    after this I get errors when recompiling.

    I hope this clears up any misunderstanding.

    Thanks,
    Deshi

  4. #4
    Join Date
    Jan 2010
    Posts
    7
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: moc.exe is not recognized as an internal or external command

    Something did came to my mind. During installation my anti-virus did detect some files they thought to be suspecious. I am not sure if those were important but I will look into again. But I do have to say that problems comes after the static configuration.

    Thanks again for any other help,
    Deshi

  5. #5
    Join Date
    Jan 2010
    Posts
    7
    Qt products
    Qt4
    Platforms
    Windows

    Angry Re: moc.exe is not recognized as an internal or external command

    This makes no sense to me.

    I finally narrow down where the problem occurs.

    First thing I did was to edit the qmake.conf by adding this line
    QMAKE_LFLAGS = -static -enable-stdcall-fixup -Wl,-enable-auto-import -Wl,-enable-runtime-pseudo-reloc

    then, I did was
    configure -static -release -no-exceptions

    Everything went well and completes everything.

    Finally when I do,
    mingw32-make sub-src

    That when the similar error shows up and never completes the build

    Here is a snippet of the error.

    collect2: ld returned 1 exit status
    mingw32-make[2]: *** [..\..\..\bin\moc.exe] Error 1
    mingw32-make[2]: Leaving directory `c:/Qt/2010.01/qt/src/tools/moc'
    mingw32-make[1]: *** [release] Error 2
    mingw32-make[1]: Leaving directory `c:/Qt/2010.01/qt/src/tools/moc'
    mingw32-make: *** [sub-moc-sub_src_target_ordered] Error 2


    I don't think it's the installation problem because I reinstalled it several times already but with the same results.

    All I want is to make my application static without any dependencies of any dll files.

    I am following this tutorial:
    http://wiki.qtcentre.org/index.php?t..._Qt_on_Windows

    Any suggestion or is just me who is get this error? Did anyone create a app that is static before?

    Thank You,
    Deshi

Similar Threads

  1. Replies: 7
    Last Post: 20th October 2012, 14:44
  2. Internal Qt4 Standards for Command Line Arguments
    By wswartzendruber in forum Newbie
    Replies: 3
    Last Post: 8th October 2009, 08:16
  3. Replies: 4
    Last Post: 14th July 2009, 04:27
  4. Replies: 15
    Last Post: 17th June 2007, 18:41
  5. 'make' is not recognized as an internal or external command
    By jivanr in forum Installation and Deployment
    Replies: 1
    Last Post: 9th June 2007, 16:55

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.