Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. Main.moc: No such file or directory
Forum Updated to NodeBB v4.3 + New Features

Main.moc: No such file or directory

Scheduled Pinned Locked Moved Installation and Deployment
7 Posts 5 Posters 21.8k Views 1 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.
  • P Offline
    P Offline
    paladin_knight
    wrote on last edited by
    #1

    Hi, I just installed Qt SDK 4.7.1 on windows Vista. I faced a problem when trying to build examples provided in the Qt. The example which I used was animatedtiles.

    Please help me to solve this. This is my first time try.bq.

    1 Reply Last reply
    0
    • joborJ Offline
      joborJ Offline
      jobor
      wrote on last edited by
      #2

      Please tell us, which compiler you're using (MSVC, mingw, madde?) and post the complete error message.

      1 Reply Last reply
      0
      • F Offline
        F Offline
        fedeb
        wrote on last edited by
        #3

        Hello!

        I have the same problem. I've installed QtCreator 2.01 based on Qt 4.7.0 and MingGW.

        Here is the compile output:

        Running build steps for project animatedtiles...
        Configuration unchanged, skipping qmake step.
        Starting: "C:/Qt/2010.05/mingw/bin/mingw32-make.exe" -w
        mingw32-make: Entering directory `C:/Qt/2010.05/qt/examples/animation/animatedtiles-build-desktop'

        C:/Qt/2010.05/mingw/bin/mingw32-make -f Makefile.Debug all

        mingw32-make[1]: Entering directory `C:/Qt/2010.05/qt/examples/animation/animatedtiles-build-desktop'

        C:/Qt/2010.05/qt/bin/moc.exe -DUNICODE -DQT_LARGEFILE_SUPPORT -DQT_DLL -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_shared' -I'../animatedtiles' -I'.' -I'../../../mkspecs/win32-g++' -D__GNUC__ -DWIN32 ../animatedtiles/main.cpp -o tmp/moc/debug_shared/main.moc

        g++ -c -g -frtti -fexceptions -mthreads -Wall -DUNICODE -DQT_LARGEFILE_SUPPORT -DQT_DLL -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_shared' -I'../animatedtiles' -I'.' -I'../../../mkspecs/win32-g++' -o tmp/obj/debug_shared/main.o ../animatedtiles/main.cpp

        c:/Qt/2010.05/qt/bin/rcc.exe -name animatedtiles ../animatedtiles/animatedtiles.qrc -o tmp/rcc/debug_shared/qrc_animatedtiles.cpp

        g++ -c -g -frtti -fexceptions -mthreads -Wall -DUNICODE -DQT_LARGEFILE_SUPPORT -DQT_DLL -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_shared' -I'../animatedtiles' -I'.' -I'../../../mkspecs/win32-g++' -o tmp/obj/debug_shared/qrc_animatedtiles.o tmp/rcc/debug_shared/qrc_animatedtiles.cpp

        g++ -enable-stdcall-fixup -Wl,-enable-auto-import -Wl,-enable-runtime-pseudo-reloc -mthreads -Wl -Wl,-subsystem,windows -o debug/animatedtiles.exe tmp/obj/debug_shared/main.o tmp/obj/debug_shared/qrc_animatedtiles.o -L'c:/Qt/2010.05/qt/lib' -L'c:/Qt/2010.05/qt/lib' -lmingw32 -lqtmaind -lQtGuid4 -lQtCored4

        mingw32-make[1]: Leaving directory `C:/Qt/2010.05/qt/examples/animation/animatedtiles-build-desktop'

        C:/Qt/2010.05/mingw/bin/mingw32-make -f Makefile.Release all

        mingw32-make[1]: Entering directory `C:/Qt/2010.05/qt/examples/animation/animatedtiles-build-desktop'

        g++ -c -O2 -frtti -fexceptions -mthreads -Wall -DUNICODE -DQT_LARGEFILE_SUPPORT -DQT_DLL -DQT_NO_DEBUG -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/release_shared' -I'../animatedtiles' -I'.' -I'../../../mkspecs/win32-g++' -o tmp/obj/release_shared/main.o ../animatedtiles/main.cpp

        mingw32-make[1]: Leaving directory `C:/Qt/2010.05/qt/examples/animation/animatedtiles-build-desktop'

        ../animatedtiles/main.cpp:132:20: error: main.moc: No such file or directory

        mingw32-make[1]: *** [tmp/obj/release_shared/main.o] Error 1

        mingw32-make: Leaving directory `C:/Qt/2010.05/qt/examples/animation/animatedtiles-build-desktop'

        mingw32-make: *** [release-all] Error 2

        The process "C:/Qt/2010.05/mingw/bin/mingw32-make.exe" exited with code %2.
        Error while building project animatedtiles (target: Desktop)
        When executing build step 'Make'

        1 Reply Last reply
        0
        • P Offline
          P Offline
          powerpun
          wrote on last edited by
          #4

          same problem.

          and, if I registered without getting the activated e-mail, how could I could do ?

          1 Reply Last reply
          0
          • P Offline
            P Offline
            powerpun
            wrote on last edited by
            #5

            in .pro file, add this to solve the problem.

            INCLUDEPATH += tmp/moc/release_shared

            1 Reply Last reply
            0
            • F Offline
              F Offline
              fedeb
              wrote on last edited by
              #6

              Hi.

              Thank you so much!

              Can you explain me why this happens? I don't know if every time I'd want to create a project this is gonna happen.

              1 Reply Last reply
              0
              • G Offline
                G Offline
                goetz
                wrote on last edited by
                #7

                This is a special version to include the moc code. All QObject based classes must be processed by the moc tool ("meta object compiler":http://doc.qt.nokia.com/latest/moc.html). In regular qmake project, the moc files are added to the source file list automatically behind the scenes. The are then included in the Makefile and the object file list for the linking stage. Instead of compiling the moc generated files manually, one can #include them into a regular cpp file too. This is what happens in your case.

                http://www.catb.org/~esr/faqs/smart-questions.html

                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