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. NMake fail with VARIADIC ! [Resolved]
QtWS25 Last Chance

NMake fail with VARIADIC ! [Resolved]

Scheduled Pinned Locked Moved Installation and Deployment
20 Posts 4 Posters 8.0k Views
  • 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 Offline
    S Offline
    Sawyer44
    wrote on last edited by
    #1

    Hi,

    I try to compile with MSVC2012 since several days.
    I already compile QT with MSVC2012 so libs are ok.

    I'm under Qt Creator. When this is the moc compilation, the command moc.exe fail.

    Console:
    @C:\Programmation-Files\VC\Qt5.0.2\5.0.2\msvc2010_opengl\bin\moc.exe -DUNICODE -DWIN32 -DQT_QML_DEBUG -DQT_DECLARATIVE_DEBUG -DQT_MULTIMEDIAWIDGETS_LIB -DQT_OPENGL_LIB -DQT_MULTIMEDIA_LIB -DQT_WIDGETS_LIB -DQT_NETWORK_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I"................\Program Files (x86)\Windows Kits\8.0\Include\um" -I"................\Program Files (x86)\Windows Kits\8.0\Include\shared" -I"................\Programmation-Files\Microsoft Visual Studio 11.0\VC\include" -I"................\Programmation-Files\VC\SFML-2.0-rc\include" -I"................\Programmation-Files\VC\OpenAL 1.1 SDK\include" -I"................\Programmation-Files\VC\libsndfile\include" -I"................\Programmation-Files\VC\Qt5.0.2\5.0.2\msvc2010_opengl\include" -I"................\Programmation-Files\VC\Qt5.0.2\5.0.2\msvc2010_opengl\include\QtMultimediaWidgets" -I"................\Programmation-Files\VC\Qt5.0.2\5.0.2\msvc2010_opengl\include\QtOpenGL" -I"................\Programmation-Files\VC\Qt5.0.2\5.0.2\msvc2010_opengl\include\QtMultimedia" -I"................\Programmation-Files\VC\Qt5.0.2\5.0.2\msvc2010_opengl\include\QtWidgets" -I"................\Programmation-Files\VC\Qt5.0.2\5.0.2\msvc2010_opengl\include\QtNetwork" -I"................\Programmation-Files\VC\Qt5.0.2\5.0.2\msvc2010_opengl\include\QtGui" -I"................\Programmation-Files\VC\Qt5.0.2\5.0.2\msvc2010_opengl\include\QtCore" -I"debug" -I"." -I"." -I"................\Programmation-Files\VC\Qt5.0.2\5.0.2\msvc2010_opengl\mkspecs\win32-msvc2010" -D_MSC_VER=1600 -DWIN32 ..\TwiigCenter\Gui\Widget.hpp -o debug\moc_Widget.cpp
    C:/Programmation-Files/Microsoft Visual Studio 11.0/VC/include/xrefwrap(156): Error: Macro argument mismatch.
    jom: C:\Users\Vincent\Dropbox\Personnal shared projects\AnimeProject\Dev\cpp\TwiigCenter-build-Desktop_Qt_5_0.2MSVC2010_32bit-Debug\Makefile.Debug [debug\moc_Widget.cpp] Error 1
    jom: C:\Users\Vincent\Dropbox\Personnal shared projects\AnimeProject\Dev\cpp\TwiigCenter-build-Desktop_Qt_5_0.2MSVC2010_32bit-Debug\Makefile [debug] Error 2
    20:17:40: Le processus "C:\Programmation-Files\Qt\Qt5.0.1\Tools\QtCreator\bin\jom.exe" s'est terminé avec le code 2.
    Error while building/deploying project TwiigCenter (kit: Desktop Qt 5.0.2 MSVC 32bit)
    Lors de l'exécution de l'étape "Make"@

    Lines from which moc.exe fail in xrefwrap are: (error is at line 7)
    @#define _CLASS_RESULT_OF_PF_OPT_0X(
    TEMPLATE_LIST, PADDING_LIST, LIST, COMMA, X1, X2, X3, X4)
    _VARIADIC_CALL_OPT_X1(_CLASS_RESULT_OF_PF,
    TEMPLATE_LIST, PADDING_LIST, LIST, COMMA,
    __cdecl, X2, X3, X4)

    _VARIADIC_EXPAND_0X(_CLASS_RESULT_OF_PF_OPT_0X, 0, 0, 0, 0)

    #undef _CLASS_RESULT_OF_PF_OPT_0X
    #undef _CLASS_RESULT_OF_PF@

    Can you help me ? really don't find the problem comes from. These headers files comes from Visual studio 2012 and i compile with nMake still from visual studio 2012. Problam can only come from moc.exe i think...

    Thanks for your help

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      This forum is an english speaking forum, you're not likely to get much help posting in french.

      That said, it seems you are using the VS2010 mkspec, are you sure your Qt5 is built for VS2012 ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • S Offline
        S Offline
        Sawyer44
        wrote on last edited by
        #3

        Hi,

        Thanks i did not pay attention... i use to speak french :p
        Yes i entirely compile Qt with VS2012 !

        each lib a i use is in x86 and is compiled with Visual Studio 2012.

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          Then.. Why is the mkspec used win32-msvc2010 ?
          Do you have multiple versions of Qt ?

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          0
          • S Offline
            S Offline
            Sawyer44
            wrote on last edited by
            #5

            The folder is the same as Qt offers on its web site. I recompile Qt with VS2012 and i replaced libs and binaries in initial downloaded folder. did I forget to replace something ?

            1 Reply Last reply
            0
            • SGaistS Offline
              SGaistS Offline
              SGaist
              Lifetime Qt Champion
              wrote on last edited by
              #6

              Ok... Wrong idea, it's better to compile from a clean source package, specially when you are changing the compiler. You have now something like a mixed 2010-2012 Qt beast with tools looking at the wrong places.

              You'd better remove that one, get the sources for the Qt you want to use, build it and add that version to Qt creator.

              And most importantly, you can't move around a Qt build on windows.

              Interested in AI ? www.idiap.ch
              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

              1 Reply Last reply
              0
              • S Offline
                S Offline
                Sawyer44
                wrote on last edited by
                #7

                Ok, i kept the compiled directory, i ll try to use it and i go back and inform you.
                Thanks

                1 Reply Last reply
                0
                • S Offline
                  S Offline
                  Sawyer44
                  wrote on last edited by
                  #8

                  Hi again,

                  I tried your solution but the same error again ...

                  Console:
                  @C:\Users\Vincent\Desktop\QT5-SRCs\qt5\qtbase\bin\moc.exe -DUNICODE -DWIN32 -DQT_QML_DEBUG -DQT_DECLARATIVE_DEBUG -DQT_MULTIMEDIAWIDGETS_LIB -DQT_OPENGL_LIB -DQT_MULTIMEDIA_LIB -DQT_WIDGETS_LIB -DQT_NETWORK_LIB -DQT_GUI_LIB -DQT_CORE_LIB -D_MSC_VER=1700 -DWIN32 -I"................\Program Files (x86)\Windows Kits\8.0\Include\um" -I"................\Program Files (x86)\Windows Kits\8.0\Include\shared" -I"................\Programmation-Files\Microsoft Visual Studio 11.0\VC\include" -I"................\Programmation-Files\VC\SFML-2.0-rc\include" -I"................\Programmation-Files\VC\OpenAL 1.1 SDK\include" -I"................\Programmation-Files\VC\libsndfile\include" -I"............\Desktop\QT5-SRCs\qt5\qtbase\include" -I"............\Desktop\QT5-SRCs\qt5\qtbase\include\QtMultimediaWidgets" -I"............\Desktop\QT5-SRCs\qt5\qtbase\include\QtOpenGL" -I"............\Desktop\QT5-SRCs\qt5\qtbase\include\QtMultimedia" -I"............\Desktop\QT5-SRCs\qt5\qtbase\include\QtWidgets" -I"............\Desktop\QT5-SRCs\qt5\qtbase\include\QtNetwork" -I"............\Desktop\QT5-SRCs\qt5\qtbase\include\QtGui" -I"............\Desktop\QT5-SRCs\qt5\qtbase\include\QtCore" -I"debug" -I"." -I"." -I"............\Desktop\QT5-SRCs\qt5\qtbase\mkspecs\win32-msvc2012" ..\TwiigCenter\MainWindow.hpp -o debug\moc_MainWindow.cpp
                  C:/Programmation-Files/Microsoft Visual Studio 11.0/VC/include/xrefwrap(156): Error: Macro argument mismatch.
                  jom: C:\Users\Vincent\Dropbox\Personnal shared projects\AnimeProject\Dev\cpp\TwiigCenter-build-Desktop_Qt_5_0_2_MSVC_32bit-Debug\Makefile.Debug [debug\moc_MainWindow.cpp] Error 1
                  C:\Users\Vincent\Desktop\QT5-SRCs\qt5\qtbase\bin\moc.exe -DUNICODE -DWIN32 -DQT_QML_DEBUG -DQT_DECLARATIVE_DEBUG -DQT_MULTIMEDIAWIDGETS_LIB -DQT_OPENGL_LIB -DQT_MULTIMEDIA_LIB -DQT_WIDGETS_LIB -DQT_NETWORK_LIB -DQT_GUI_LIB -DQT_CORE_LIB -D_MSC_VER=1700 -DWIN32 -I"................\Program Files (x86)\Windows Kits\8.0\Include\um" -I"................\Program Files (x86)\Windows Kits\8.0\Include\shared" -I"................\Programmation-Files\Microsoft Visual Studio 11.0\VC\include" -I"................\Programmation-Files\VC\SFML-2.0-rc\include" -I"................\Programmation-Files\VC\OpenAL 1.1 SDK\include" -I"................\Programmation-Files\VC\libsndfile\include" -I"............\Desktop\QT5-SRCs\qt5\qtbase\include" -I"............\Desktop\QT5-SRCs\qt5\qtbase\include\QtMultimediaWidgets" -I"............\Desktop\QT5-SRCs\qt5\qtbase\include\QtOpenGL" -I"............\Desktop\QT5-SRCs\qt5\qtbase\include\QtMultimedia" -I"............\Desktop\QT5-SRCs\qt5\qtbase\include\QtWidgets" -I"............\Desktop\QT5-SRCs\qt5\qtbase\include\QtNetwork" -I"............\Desktop\QT5-SRCs\qt5\qtbase\include\QtGui" -I"............\Desktop\QT5-SRCs\qt5\qtbase\include\QtCore" -I"debug" -I"." -I"." -I"............\Desktop\QT5-SRCs\qt5\qtbase\mkspecs\win32-msvc2012" ..\TwiigCenter\Gui\Widget.hpp -o debug\moc_Widget.cpp
                  C:/Programmation-Files/Microsoft Visual Studio 11.0/VC/include/xrefwrap(156): Error: Macro argument mismatch.
                  jom: C:\Users\Vincent\Dropbox\Personnal shared projects\AnimeProject\Dev\cpp\TwiigCenter-build-Desktop_Qt_5_0_2_MSVC_32bit-Debug\Makefile.Debug [debug\moc_Widget.cpp] Error 1
                  jom: C:\Users\Vincent\Dropbox\Personnal shared projects\AnimeProject\Dev\cpp\TwiigCenter-build-Desktop_Qt_5_0_2_MSVC_32bit-Debug\Makefile [debug] Error 2
                  11:35:33: Le processus "C:\Programmation-Files\Qt\Qt5.0.1\Tools\QtCreator\bin\jom.exe" s'est terminé avec le code 2.
                  Error while building/deploying project TwiigCenter (kit: Desktop Qt 5.0.2 MSVC 32bit)
                  Lors de l'exécution de l'étape "Make"@

                  May this help to find what is the problem ?

                  Thanks,

                  1 Reply Last reply
                  0
                  • SGaistS Offline
                    SGaistS Offline
                    SGaist
                    Lifetime Qt Champion
                    wrote on last edited by
                    #9

                    Are you sure you didn't modify your custom built Qt ?

                    Did you try with a project created from scratch to ensure everything is setup correctly ?

                    Interested in AI ? www.idiap.ch
                    Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                    1 Reply Last reply
                    0
                    • S Offline
                      S Offline
                      Sawyer44
                      wrote on last edited by
                      #10

                      No, but i just see that package for 64bit version of Qt5 is available built with VS2012 !!
                      That's cool for me, because correctly setup compiled version of qt5 is pretty difficult when you don't know how to do ....

                      I m downloading it, and i ll try to compile with it. I go back and inform you about success or not.

                      meanwhile, i post a new topic: http://qt-project.org/forums/viewthread/27141/ about this package...

                      1 Reply Last reply
                      0
                      • S Offline
                        S Offline
                        Sawyer44
                        wrote on last edited by
                        #11

                        I come back with still errors at building. Now, i use qt buil msvc2012 x64 and the error is the same. I really didn't know what is the fuck....

                        I discovered a similar problem with boost inclusion in moc : http://qt-project.org/forums/viewthread/22993

                        Console:
                        @C:\Programmation-Files\VC\Qt5.0.2\5.0.2\msvc2012_64\bin\moc.exe -DUNICODE -DWIN32 -DQT_QML_DEBUG -DQT_DECLARATIVE_DEBUG -DQT_MULTIMEDIAWIDGETS_LIB -DQT_OPENGL_LIB -DQT_MULTIMEDIA_LIB -DQT_WIDGETS_LIB -DQT_NETWORK_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_OPENGL_ES_2 -DQT_OPENGL_ES_2_ANGLE -I"................\Program Files (x86)\Windows Kits\8.0\Include\um" -I"................\Program Files (x86)\Windows Kits\8.0\Include\shared" -I"................\Programmation-Files\Microsoft Visual Studio 11.0\VC\include" -I"................\Programmation-Files\VC\SFML-2.0-rc\include" -I"................\Programmation-Files\VC\OpenAL 1.1 SDK\include" -I"................\Programmation-Files\VC\libsndfile\include" -I"................\Programmation-Files\VC\Qt5.0.2\5.0.2\msvc2012_64\include" -I"................\Programmation-Files\VC\Qt5.0.2\5.0.2\msvc2012_64\include\QtMultimediaWidgets" -I"................\Programmation-Files\VC\Qt5.0.2\5.0.2\msvc2012_64\include\QtOpenGL" -I"................\Programmation-Files\VC\Qt5.0.2\5.0.2\msvc2012_64\include\QtMultimedia" -I"................\Programmation-Files\VC\Qt5.0.2\5.0.2\msvc2012_64\include\QtWidgets" -I"................\Programmation-Files\VC\Qt5.0.2\5.0.2\msvc2012_64\include\QtNetwork" -I"................\Programmation-Files\VC\Qt5.0.2\5.0.2\msvc2012_64\include\QtGui" -I"................\Programmation-Files\VC\Qt5.0.2\5.0.2\msvc2012_64\include\QtCore" -I"debug" -I"." -I"." -I"................\Programmation-Files\VC\Qt5.0.2\5.0.2\msvc2012_64\mkspecs\win32-msvc2012" -D_MSC_VER=1700 -DWIN32 ..\TwiigCenter\Gui\Widget.hpp -o debug\moc_Widget.cpp
                        C:/Programmation-Files/Microsoft Visual Studio 11.0/VC/include/xrefwrap(156): Error: Macro argument mismatch.
                        jom: C:\Users\Vincent\Dropbox\Personnal shared projects\AnimeProject\Dev\cpp\build-TwiigCenter-Desktop_Qt_5_0_2_MSVC2012_64bit-Debug\Makefile.Debug [debug\moc_Widget.cpp] Error 1
                        jom: C:\Users\Vincent\Dropbox\Personnal shared projects\AnimeProject\Dev\cpp\build-TwiigCenter-Desktop_Qt_5_0_2_MSVC2012_64bit-Debug\Makefile [debug] Error 2
                        19:21:38: Le processus "C:\Programmation-Files\VC\Qt5.0.2\Tools\QtCreator\bin\jom.exe" s'est terminé avec le code 2.
                        Erreur lors de la compilation/déploiement du projet TwiigCenter (kit : Desktop Qt 5.0.2 MSVC2012 64bit)
                        Lors de l'exécution de l'étape "Make"
                        19:21:38: Elapsed time: 00:49.@

                        It seems it is a VARIADIC problem ...

                        any idea, i really have difficulties to solve the problem ....

                        Thanks !

                        1 Reply Last reply
                        0
                        • S Offline
                          S Offline
                          Sawyer44
                          wrote on last edited by
                          #12

                          Hi,

                          For people searching for a solution it's quite simple.
                          I lost a lot of days ....

                          So, i consider moc.exe is not compatible yet with VS2012 headers. (not all -> xrefwrap)
                          The solution is to remove includes from HPP files for your class implementing Q_OBJECT macro.
                          It avoid moc.exe to use includes... To do that properly, just use Q_MOC_RUN macro like this for example:
                          @#ifndef Q_MOC_RUN
                          #include <QObject>

                          #include "AnimeBoxItemView.hpp"
                          #include "../../Network/Models/AnimeModel.hpp"
                          

                          #endif@

                          Then, juste relaunch builder and everything works....
                          Good luck and thanks....

                          1 Reply Last reply
                          0
                          • SGaistS Offline
                            SGaistS Offline
                            SGaist
                            Lifetime Qt Champion
                            wrote on last edited by
                            #13

                            Haaa... The worst is that i followed that boost thread but I completely forgot it... Sorry

                            Great you could find a working solution !

                            Don't forget to update the thread's title so other forum users may know that a solution has been found :)

                            Interested in AI ? www.idiap.ch
                            Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                            1 Reply Last reply
                            0
                            • S Offline
                              S Offline
                              Sawyer44
                              wrote on last edited by
                              #14

                              yes, i saw the boost thread too :p
                              Thanks u anyway :)

                              I update the title ...

                              1 Reply Last reply
                              0
                              • A Offline
                                A Offline
                                aenima1891
                                wrote on last edited by
                                #15

                                I've the same problem: Error Macro Argumento Mismatch in xrefwrap file.
                                I'm using Qt5.1.1 msvc2012 x64.

                                I've understood that i must remove all msvc2012 headers (like <iostream>) from my QObject class headers. Is this correct?

                                Can someone give me more explanations?

                                Thanks!

                                1 Reply Last reply
                                0
                                • T Offline
                                  T Offline
                                  tiagocc0
                                  wrote on last edited by
                                  #16

                                  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.

                                  1 Reply Last reply
                                  0
                                  • A Offline
                                    A Offline
                                    aenima1891
                                    wrote on last edited by
                                    #17

                                    Thank you so much tiagocc0. It works!
                                    However, now I've 96 warnings "Macro argument mismatch" xrefwrap.
                                    I hope that Qt5.2 will solve this issue.

                                    1 Reply Last reply
                                    0
                                    • T Offline
                                      T Offline
                                      tiagocc0
                                      wrote on last edited by
                                      #18

                                      The warnings will probably continue to occur since the moc code doesn't know much about VARIADIC, so it was probably making a wrong assumption that may be valid at some cases.

                                      It is strange though because in my case this error started to appear after I changed my local profile to a domain profile with the help of an automatic profile exporter. So I must have something wrong like an environment variable or something that started to cause this issue.
                                      It happens at work, but not at home.

                                      It happened once too when I had Visual Studio 2010 and uninstalled it to install Visual Studio 2012, the exact same error, at the time I resolved the issue by reinstalling Windows, then just installing Visual Studio 2012 and the latest Qt at the time (5).

                                      Unless you are using boost which is known to cause this issue.

                                      1 Reply Last reply
                                      0
                                      • A Offline
                                        A Offline
                                        aenima1891
                                        wrote on last edited by
                                        #19

                                        I'm not using boost.
                                        I think you're right: this problem may be due by an environment variable. Infact, this happens at work but not at home to me too.
                                        I'd like to know what's the cause of this issue...

                                        1 Reply Last reply
                                        0
                                        • T Offline
                                          T Offline
                                          tiagocc0
                                          wrote on last edited by
                                          #20

                                          This is a long shot but..

                                          I don't have access to the registry here at work, I'm thinking this might be one of the issues since when I try to open the command line from MSVC 2012 it gives me an error, after analyzing the .bat files I noticed they use the reg.exe file to query the registry.
                                          When I had my local account here at work I had full access to the registry and I lost it when I migrated to the domain account.
                                          So it might not be Qt itself but rather MSVC that isn't properly configured.

                                          Where you have the problem, do have access to use reg.exe or regedit.exe?

                                          When I reinstalled Windows to resolve my issue I had also changed from domain account in Win7 to a local account in Win8.

                                          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