Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Update: Forum Guidelines & Code of Conduct


    Qt World Summit: Early-Bird Tickets

    [Solved] error: [debug/moc_mainwindow.cpp] Error 1

    General and Desktop
    7
    16
    59202
    Loading More Posts
    • 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
      szh1 last edited by

      I am getting an error: [debug/moc_mainwindow.cpp] Error 1
      Here is the output from the "Compile Output" tab:
      Running build steps for project ExtremeImageConverter...
      Starting: "c:/qt/2010.05/qt/bin/qmake.exe" C:/My Dropbox/Extreme Image Converter/Extreme Image Converter/ExtremeImageConverter.pro -r -spec win32-g++
      The process "c:/qt/2010.05/qt/bin/qmake.exe" exited normally.
      Starting: "C:/Qt/2010.05/mingw/bin/mingw32-make.exe" -w
      mingw32-make: Entering directory `C:/My Dropbox/Extreme Image Converter/ExtremeImageConverter-build-desktop'

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

      mingw32-make[1]: Entering directory `C:/My Dropbox/Extreme Image Converter/ExtremeImageConverter-build-desktop'

      c:\Qt\2010.05\qt\bin\uic.exe "..\Extreme Image Converter\mainwindow.ui" -o ui_mainwindow.h

      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"......\Qt\2010.05\qt\include\QtCore" -I"......\Qt\2010.05\qt\include\QtGui" -I"......\Qt\2010.05\qt\include" -I"......\Qt\2010.05\qt\include\ActiveQt" -I"debug" -I"." -I"..\Extreme Image Converter" -I"." -I"......\Qt\2010.05\qt\mkspecs\win32-g++" -o debug\main.o "..\Extreme Image Converter\main.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"......\Qt\2010.05\qt\include\QtCore" -I"......\Qt\2010.05\qt\include\QtGui" -I"......\Qt\2010.05\qt\include" -I"......\Qt\2010.05\qt\include\ActiveQt" -I"debug" -I"." -I"..\Extreme Image Converter" -I"." -I"......\Qt\2010.05\qt\mkspecs\win32-g++" -o debug\mainwindow.o "..\Extreme Image Converter\mainwindow.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"......\Qt\2010.05\qt\include\QtCore" -I"......\Qt\2010.05\qt\include\QtGui" -I"......\Qt\2010.05\qt\include" -I"......\Qt\2010.05\qt\include\ActiveQt" -I"debug" -I"." -I"..\Extreme Image Converter" -I"." -I"......\Qt\2010.05\qt\mkspecs\win32-g++" -o debug\imageconverter.o "..\Extreme Image Converter\imageconverter.cpp"

      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"......\Qt\2010.05\qt\include\QtCore" -I"......\Qt\2010.05\qt\include\QtGui" -I"......\Qt\2010.05\qt\include" -I"......\Qt\2010.05\qt\include\ActiveQt" -I"debug" -I"." -I"..\Extreme Image Converter" -I"." -I"......\Qt\2010.05\qt\mkspecs\win32-g++" -D__GNUC__ -DWIN32 ..\Extreme Image Converter\mainwindow.h -o debug\moc_mainwindow.cpp

      moc: Too many input files specified

      Usage: moc [options] <header-file>

      -o<file> write output to file rather than stdout

      -I<dir> add dir to the include path for header files

      -E preprocess only; do not generate meta object code

      -D<macro>[=<def>] define macro, with optional definition

      -U<macro> undefine macro

      -i do not generate an #include statement

      -p<path> path prefix for included file

      -f[<file>] force #include, optional file name

      -nw do not display warnings

      @<file> read additional options from file

      -v display version of moc

      mingw32-make[1]: Leaving directory `C:/My Dropbox/Extreme Image Converter/ExtremeImageConverter-build-desktop'

      mingw32-make: Leaving directory `C:/My Dropbox/Extreme Image Converter/ExtremeImageConverter-build-desktop'

      mingw32-make[1]: *** [debug/moc_mainwindow.cpp] Error 1

      mingw32-make: *** [debug] Error 2

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

      1 Reply Last reply Reply Quote 0
      • D
        DenisKormalev last edited by

        Hm, for some reason path for moc'ed file is not wrapped with quotes. You wrote makefile by yourself or generated it with qmake/cmake? If first doublcheck it for paths.

        1 Reply Last reply Reply Quote 0
        • S
          szh1 last edited by

          It is generated by Qmake.

          1 Reply Last reply Reply Quote 0
          • D
            DenisKormalev last edited by

            can you post it here? maybe there are some problems.

            1 Reply Last reply Reply Quote 0
            • S
              szh1 last edited by

              [removed]

              1 Reply Last reply Reply Quote 0
              • D
                DenisKormalev last edited by

                oops, I meant .pro file :)

                1 Reply Last reply Reply Quote 0
                • S
                  szh1 last edited by

                  [removed]

                  I don't see anything wrong with it. It built fine until today. I just moved the project to a different location on my hard drive.

                  I remember having this problem once, but I don't remember how I fixed it.

                  1 Reply Last reply Reply Quote 0
                  • D
                    DenisKormalev last edited by

                    Try to remove .pro.user file at new location and open project again in QtCreator.

                    1 Reply Last reply Reply Quote 0
                    • S
                      szh1 last edited by

                      I tried that. Same.

                      1 Reply Last reply Reply Quote 0
                      • S
                        szh1 last edited by

                        I just uninstalled and reinstalled the Qt SDK, but it didn't change anything. I also tried copying the files again, even to a different place. It is still not building.

                        1 Reply Last reply Reply Quote 0
                        • S
                          szh1 last edited by

                          I created a new empty project, imported the old files, and now it's working!

                          1 Reply Last reply Reply Quote 0
                          • V
                            vinurocks last edited by

                            Your Build directory path must not contain spaces.. In your case `C:/My Dropbox/Extreme Image Converter/ExtremeImageConverter-build-desktop’ contains spaces..

                            1 Reply Last reply Reply Quote 0
                            • MarcosAD
                              MarcosAD last edited by

                              @szh1 said:

                              [debug/moc_mainwindow.cpp] Error 1

                              I know this is a very old post but I've just bumped into it. This could be helpful.
                              This kind of errors:
                              [debug/moc_mainwindow.cpp] Error 1
                              [debug/moc_*cpp] Error 1

                              might come when declaring class data members in the slots / signals section by mistake.

                              M 1 Reply Last reply Reply Quote 7
                              • omert
                                omert last edited by

                                Remove your file from project (not permanently) than add again with "Add Existing Files"

                                1 Reply Last reply Reply Quote 0
                                • M
                                  Mohammad Kanan @MarcosAD last edited by

                                  This post is deleted!
                                  1 Reply Last reply Reply Quote 0
                                  • E
                                    eximus last edited by eximus

                                    @MarcosAD said in [Solved] error: [debug/moc_mainwindow.cpp] Error 1:

                                    I know this is a very old post but I've just bumped into it. This could be helpful.
                                    This kind of errors:
                                    [debug/moc_mainwindow.cpp] Error 1
                                    [debug/moc_*cpp] Error 1
                                    might come when declaring class data members in the slots / signals section by mistake.

                                    In my case I've got the same error: I use enum members of 3.h file in 1.cpp file, the 3.h file wasn't included into 1.cpp file (and no warning from Qt Creator 12.3.1). Also, when I have the same enum in 1.h and in 3.h files and use it in 1.cpp file.

                                    1 Reply Last reply Reply Quote 0
                                    • First post
                                      Last post