View Full Version : How to use Windows SDK in QT?

22nd March 2011, 21:35
I am using QT 2010.05 for windows in Windows XP.

I am trying to to use Window SDK and got following error.

#error Must define a target architecture
c\Program FIles\Microsoft SDKs\Windows\v5.0\Include\winnt.h

What can I do to fix it? :confused:

22nd March 2011, 22:38
As far as i know the Windows SDK provided by Microsoft can be used only with Visual Studio, but MinGW comes with some headers (included windows.h and winnt.h) so include that, and if they don't provide the same functionality (or you require more functionality that is not provided by MinGW headers) you need to switch to Visual Studio.

I just built a simple Winapi "hello world" and it works (Qt SDK beta - as far as i know uses MinGW 4.4.0):

#include <windows.h>

int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
LPSTR lpCmdLine, int nCmdShow)
MessageBox(NULL, L"Hello world!", L"Note", MB_OK);
return 0;