Qmake: Error compiling qtforms from the Maya devkit

I’m trying to compile qtforms which is one of the Qt example plugins provided by Autodesk with the Maya Devkit. It demonstrates 3 different ways to integrate Qt in a maya plugin.

You can find it here: devkit plug-ins

I’ve been through several issues already but I am now stuck with errors while compiling.Here is the output:

C:\Program Files (x86)\Microsoft Visual Studio 12.0>cd C:\Users\A\Documents\Visu
al Studio 2013\Projects\qtForms

C:\Users\A\Documents\Visual Studio 2013\Projects\qtForms>nmake -f Makefile.qt re
lease\qtForms.mll

Microsoft (R) Program Maintenance Utility Version 12.00.21005.1
Copyright (C) Microsoft Corporation.  All rights reserved.

        qmake -makefile -o qtForms.mak qtForms.pro
        "C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\BIN
make.exe" -
nologo -f qtForms.mak
        "C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\BIN
make.exe" -
f qtForms.mak.Release
        C:\Autodesk\Maya2016\bin\moc.exe -DUNICODE -DWIN32 -DQT_NO_IMPORT_QT47_Q
ML -DNDEBUG -D_WINDOWS -DNT_PLUGIN -DQT_DLL -DQT_NO_DEBUG -DQT_PLUGIN -DQT_XML_L
IB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_HAVE_MMX -DQT_HAVE_3DNOW -DQT_HAVE_SSE -DQT_H
AVE_MMXEXT -DQT_HAVE_SSE2 -DQT_THREAD_SUPPORT -I"c:\Autodesk\Maya2016\include\Qt
UiTools" -I"c:\Autodesk\Maya2016\include\QtCore" -I"c:\Autodesk\Maya2016\include
\QtGui" -I"c:\Autodesk\Maya2016\include\QtXml" -I"c:\Autodesk\Maya2016\include"
-I"." -I"..\..\include" -I"c:\Autodesk\Maya2016\include\ActiveQt" -I"release" -I
"." -I"c:\Autodesk\Maya2016\mkspecs\win32-msvc2012" -D_MSC_VER=1700 -DWIN32 qtFo
rms.h -o release\moc_qtForms.cpp
        c:\Autodesk\Maya2016\bin\rcc.exe -name qtForms qtForms.qrc -o release\qr
c_qtForms.cpp
        cl -c -nologo -Zm200 -Zc:wchar_t /FD /GS -O2 -MD -Zi -W3 -w34100 -w34189
 -GR -EHsc -DUNICODE -DWIN32 -DQT_NO_IMPORT_QT47_QML -DNDEBUG -D_WINDOWS -DNT_PL
UGIN -DQT_DLL -DQT_NO_DEBUG -DQT_PLUGIN -DQT_XML_LIB -DQT_GUI_LIB -DQT_CORE_LIB
-DQT_HAVE_MMX -DQT_HAVE_3DNOW -DQT_HAVE_SSE -DQT_HAVE_MMXEXT -DQT_HAVE_SSE2 -DQT
_THREAD_SUPPORT -I"c:\Autodesk\Maya2016\include\QtUiTools" -I"c:\Autodesk\Maya20
16\include\QtCore" -I"c:\Autodesk\Maya2016\include\QtGui" -I"c:\Autodesk\Maya201
6\include\QtXml" -I"c:\Autodesk\Maya2016\include" -I"." -I"..\..\include" -I"c:\
Autodesk\Maya2016\include\ActiveQt" -I"release" -I"." -I"c:\Autodesk\Maya2016\mk
specs\win32-msvc2012" -Forelease\ @C:\Users\A\AppData\Local\Temp
m81FD.tmp
qtForms.cpp
        cl -c -nologo -Zm200 -Zc:wchar_t /FD /GS -O2 -MD -Zi -W3 -w34100 -w34189
 -GR -EHsc -DUNICODE -DWIN32 -DQT_NO_IMPORT_QT47_QML -DNDEBUG -D_WINDOWS -DNT_PL
UGIN -DQT_DLL -DQT_NO_DEBUG -DQT_PLUGIN -DQT_XML_LIB -DQT_GUI_LIB -DQT_CORE_LIB
-DQT_HAVE_MMX -DQT_HAVE_3DNOW -DQT_HAVE_SSE -DQT_HAVE_MMXEXT -DQT_HAVE_SSE2 -DQT
_THREAD_SUPPORT -I"c:\Autodesk\Maya2016\include\QtUiTools" -I"c:\Autodesk\Maya20
16\include\QtCore" -I"c:\Autodesk\Maya2016\include\QtGui" -I"c:\Autodesk\Maya201
6\include\QtXml" -I"c:\Autodesk\Maya2016\include" -I"." -I"..\..\include" -I"c:\
Autodesk\Maya2016\include\ActiveQt" -I"release" -I"." -I"c:\Autodesk\Maya2016\mk
specs\win32-msvc2012" -Forelease\ @C:\Users\A\AppData\Local\Temp
m8604.tmp
moc_qtForms.cpp
c:\Autodesk\Maya2016\include\QtCore/qmetatype.h(357) : error C2065: 'ULONG' : un
declared identifier
c:\Autodesk\Maya2016\include\QtCore/qmetatype.h(357) : error C2923: 'QMetaTypeId
2' : 'ULONG' is not a valid template type argument for parameter 'T'
c:\Autodesk\Maya2016\include\QtCore/qmetatype.h(357) : error C2913: explicit spe
cialization; 'QMetaTypeId2' is not a specialization of a class template

[...same error on different lines]

c:\Autodesk\Maya2016\include\QtCore/qmetatype.h(412) : error C2913: explicit spe
cialization; 'QMetaTypeId2' is not a specialization of a class template
c:\Autodesk\Maya2016\include\QtCore/qhash.h(69) : error C2065: 'ULONG' : undecla
red identifier
c:\Autodesk\Maya2016\include\QtCore/qhash.h(69) : error C2146: syntax error : mi
ssing ')' before identifier 'key'
c:\Autodesk\Maya2016\include\QtCore/qhash.h(69) : error C2433: 'qHash' : 'inline
' not permitted on data declarations
c:\Autodesk\Maya2016\include\QtCore/qhash.h(69) : error C2365: 'qHash' : redefin
ition; previous definition was 'function'
c:\Autodesk\Maya2016\include\QtCore/qhash.h(69) : error C2059: syntax error : ')
'
c:\Autodesk\Maya2016\include\QtCore/qhash.h(70) : error C2143: syntax error : mi
ssing ';' before '{'
c:\Autodesk\Maya2016\include\QtCore/qhash.h(70) : error C2447: '{' : missing fun
ction header (old-style formal list?)
c:\Autodesk\Maya2016\include\QtCore/qhash.h(77) : error C3861: 'ULONG': identifi
er not found
c:\autodesk\maya2016\include\qtcore\qvariant.h(612) : error C2913: explicit spec
ialization; 'QMetaTypeId2' is not a specialization of a class template
c:\autodesk\maya2016\include\qtcore\qvariant.h(613) : error C2913: explicit spec
ialization; 'QMetaTypeId2' is not a specialization of a class template
c:\autodesk\maya2016\include\qtcore\qvariant.h(614) : error C2913: explicit spec
ialization; 'QMetaTypeId2' is not a specialization of a class template
qrc_qtForms.cpp
Generating Code...
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 12.0
\VC\BIN\cl.EXE"' : return code '0x2'
Stop.
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 12.0
\VC\BIN
make.exe"' : return code '0x2'
Stop.
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 12.0
\VC\BIN
make.exe"' : return code '0x2'
Stop.

I’ve found this thread which seems pretty similar to what I’m experiencing right now.

Any idea how I can fix this ?

According to this: http://stackoverflow.com/questions/6943865/visual-c-cant-find-windows-types-like-pvoid-dword-ulong-etc, I’ve given #include<windows.h> another try, this time including it before anything else in qtForms.h and it worked.