Moc_ ...problem



  • make: *** [moc_qtnifalldetection.cpp] Error 1
    19:46:20: The process "/usr/bin/make" exited with code 2.
    Error while building/deploying project QtNIFallDetection (kit: Desktop Qt 5.0.2 GCC 64bit)
    When executing step 'Make'


    Any idea to solve this problem?

    thanks



  • Did you try to rebuild the whole project?



  • yes...


  • Lifetime Qt Champion

    Hi,

    Could you post a more complete error log ? From this it's not easy at all to see the problem, there should be more lines above that says what caused the error.



  • 1:50:53: Running steps for project QtNIFallDetection...
    21:50:53: Configuration unchanged, skipping qmake step.
    21:50:53: Starting: "/usr/bin/make"
    /home/alessio/Qt5.0.2/5.0.2/gcc_64/bin/moc -DQT_QML_DEBUG -DQT_DECLARATIVE_DEBUG -DQT_WIDGETS_LIB -DQT_XML_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I../Qt5.0.2/5.0.2/gcc_64/mkspecs/linux-g++-64 -I../QtNIFallDetection -I/usr/include/ni -I../Qt5.0.2/5.0.2/gcc_64/include -I../Qt5.0.2/5.0.2/gcc_64/include/QtWidgets -I../Qt5.0.2/5.0.2/gcc_64/include/QtXml -I../Qt5.0.2/5.0.2/gcc_64/include/QtGui -I../Qt5.0.2/5.0.2/gcc_64/include/QtCore -I. -I. -I. ../QtNIFallDetection/qtnifalldetection.h -o moc_qtnifalldetection.cpp
    /usr/include/ni/XnCppWrapper.h:10019: Error: Macro argument mismatch.
    make: *** [moc_qtnifalldetection.cpp] Error 1
    21:50:53: The process "/usr/bin/make" exited with code 2.
    Error while building/deploying project QtNIFallDetection (kit: Desktop Qt 5.0.2 GCC 64bit)
    When executing step 'Make'
    21:50:53: Elapsed time: 00:00.


    Thanks for the help


  • Lifetime Qt Champion

    There seems to be a collision between a macro in XnCppWrapper.h and a Qt macro.

    Have a look in XnCppWrapper, search for a macro/function name (i.e signal, slot etc...) that could also be found in Qt.



  • Hi,
    Was this ever solved? I'm struggling with the same issue.


  • Lifetime Qt Champion

    Hi,

    Good question, what you can try to do is add:

    @ CONFIG += no_keywords@

    to your pro file and use Q_SIGNAL, Q_SLOT, Q_EMIT etc... in your code (you can learn more in the "Signals & Slots" documentation chapter



  • I've got exactly the same problem here on my computer...
    @/usr/include/ni/XnCppWrapper.h:10019: Error: Macro argument mismatch.@


  • Lifetime Qt Champion

    Did you try what I suggested ?



  • Hi, SGaist:

    Thank you for your prompt reply. I investigated the line 10019 of file /usr/include/ni/XnCppWrapper.h , it is @XN_VALIDATE_NEW(pTrans, StateChangedCallbackTranslator, handler, pCookie);@ I really can't tell

    which Marco in OpenNI-1.5.4 conflicts with Qt-5.0.1?

    If it is a Macro conflict issue, hHow to solve this kind of Macro conflict problem? I remember in my code, if there is such Macro conflict, the compiler will* take the one defined later without error message*.

    Well, anyway, I'm still trying your
    @ CONFIG += no_keywords@, but this will take some time. I've got a big project here....

    Anyway, thank you so much...

    Cheers
    Pei

    [quote author="SGaist" date="1375794678"]Did you try what I suggested ?[/quote]



  • Hi, SGaist:

    I've already tested your suggested method, but unfortunately, your suggestion doesn't solve my problem for the time being. What I can ascertain is: all the QT keywords in my former project have all being replace by Q_SIGNAL, Q_SLOT, Q_EMIT ...

    Question is still:
    /usr/include/ni/XnCppWrapper.h:10019: Error: Macro argument mismatch.
    make: *** [../Output/mocs/moc_mainwindow.cpp] Error 1

    [quote author="SGaist" date="1375794678"]Did you try what I suggested ?[/quote]


  • Lifetime Qt Champion

    Are you using OpenNI ? If so I've stumbled upon "this":http://code.google.com/p/qtkinectwrapper/ that might help



  • Like I have posted here: http://qt-project.org/forums/viewthread/27125/#151289

    The issue is with the moc.exe file, in Qt 5.2 beta they have changed it from error to warning, so now you can compile.
    You can either upgrade to 5.2 or you can just get the moc.exe file and put it in the 5.1.1 bin folder like I did, it works.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.