PDA

View Full Version : moc.exe is not recognized as an internal or external command



Deshi
22nd January 2010, 06:01
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

squidge
22nd January 2010, 08:37
It seems you have an installation problem, as Qt should be where its looking. Try reinstalling Qt.

Deshi
22nd January 2010, 09:48
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

Deshi
22nd January 2010, 09:54
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

Deshi
23rd January 2010, 00:40
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?title=Building_static_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