Nominate our 2022 Qt Champions!

What does this code mean? error: [debug/moc_user.cpp] Error 1

  • 12:45:33: Configuration unchanged, skipping qmake step.
    12:45:33: Starting: "C:\Qt\Qt5.5.0\Tools\mingw492_32\bin\mingw32-make.exe" 
    C:/Qt/Qt5.5.0/Tools/mingw492_32/bin/mingw32-make -f Makefile.Debug
    mingw32-make[1]: Entering directory 'A:/work/repos/QtTest/Bos_MVP2/build-Bos_MVP2-Desktop_Qt_5_5_0_MinGW_32bit-Debug'
    C:\Qt\Qt5.5.0\5.5\mingw492_32\bin\moc.exe -DUNICODE -DQT_QML_DEBUG -DQT_DECLARATIVE_DEBUG -DQT_QUICK_LIB -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_QML_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -DQT_NEEDS_QMAIN -D__GNUC__ -DWIN32 -IC:/Qt/Qt5.5.0/5.5/mingw492_32/mkspecs/win32-g++ -IA:/work/repos/QtTest/Bos_MVP2/Bos_MVP2 -IC:/Qt/Qt5.5.0/5.5/mingw492_32/include -IC:/Qt/Qt5.5.0/5.5/mingw492_32/include/QtQuick -IC:/Qt/Qt5.5.0/5.5/mingw492_32/include/QtWidgets -IC:/Qt/Qt5.5.0/5.5/mingw492_32/include/QtGui -IC:/Qt/Qt5.5.0/5.5/mingw492_32/include/QtANGLE -IC:/Qt/Qt5.5.0/5.5/mingw492_32/include/QtQml -IC:/Qt/Qt5.5.0/5.5/mingw492_32/include/QtNetwork -IC:/Qt/Qt5.5.0/5.5/mingw492_32/include/QtCore -I. ..\Bos_MVP2\user.h -o debug\moc_user.cpp
    Makefile.Debug:658: recipe for target 'debug/moc_user.cpp' failed
    mingw32-make[1]: *** [debug/moc_user.cpp] Error 1
    mingw32-make[1]: Leaving directory 'A:/work/repos/QtTest/Bos_MVP2/build-Bos_MVP2-Desktop_Qt_5_5_0_MinGW_32bit-Debug'
    mingw32-make: *** [debug] Error 2
    makefile:34: recipe for target 'debug' failed
    12:45:36: The process "C:\Qt\Qt5.5.0\Tools\mingw492_32\bin\mingw32-make.exe" exited with code 2.
    Error while building/deploying project Bos_MVP2 (kit: Desktop Qt 5.5.0 MinGW 32bit)
    When executing step "Сборка"
    12:45:36: Elapsed time: 00:03.```

  • @Kofr said:

    mingw32-make[1]: Entering directory 'A:/work/repos/QtTest/Bos_MVP2/build-Bos_MVP2-Desktop_Qt_5_5_0_MinGW_32bit-Debug'
    Are you really using drive A:? 
    Have not seen this for years ;) 
    @Kofr said:
    > ```
    > Makefile.Debug:658: recipe for target 'debug/moc_user.cpp' failed
    > mingw32-make[1]: *** [debug/moc_user.cpp] Error 1

    The meta object compiler did not create moc_user.cpp
    Try to run qmake manually from Qt creator and rebuild.

  • @koahnig You may believe that it is floppy drive ahaha
    How to deal with this QMake?? I have never used it before. Is there any other ways to test operability without going deeply in QMake??

  • I assumed you are using Qt creator, are you?
    There you can go to the projects pane on the left. Right click on the project's name. There you should see an entry "Run qmake". Click on that and a little somewhere on "Rebuild".

    Today 'A' and 'B' are useless letters at least as long as a programmer does not print hex ;)

  • @koahnig running QMake is succesful
    Building returns :-1: error: [debug/moc_user.cpp] Error 1
    The reason might be in Qt 5.5 as with Qt 5.4 everything was ok.

  • You did a complete rebuild as well?
    The run of qmake does not create an error code, but it does not introduce a moc statement into makefile.
    I guess you are using a shadow for compiling. Delete the whole shadow folder, rerun qmake once again and rebuild.

    If you think it imay be a bug related to Qt 5.5 you can check on JIRA.