I have quite simple task to compile working code for bluetooth socket.

I have:
QtCreator 4.7.0, mingw, Windows Platform SDK 2003, - WindowsXP

The code for Bluetooth API strarting with:
Qt Code:
  1. #include <bthsdpdef.h>
  2. #include <BluetoothAPIs.h>
  3. #include <winsock2.h>
  4. #include <ws2bth.h>
  5.  
  6. void Run( )
  7. {
  8. WORD wVersionRequested = 0x202;
  9. WSADATA m_data;
  10. if (0 == ::WSAStartup(wVersionRequested, &m_data))
  11. {
  12. SOCKET s = ::socket(AF_BTH, SOCK_STREAM, BTHPROTO_RFCOMM);
  13. const DWORD lastError = ::GetLastError();
  14. if (s == INVALID_SOCKET)
  15. {
  16. ....
  17. etc...
To copy to clipboard, switch view to plain text mode 

In .pro file I'm writing:
Qt Code:
  1. INCLUDEPATH += "C:\\Program Files\\Microsoft Platform SDK\\Include"
To copy to clipboard, switch view to plain text mode 

Error:
..\..\Program Files\Microsoft Platform SDK\Include/winnt.h:666:2: error: #error Must define a target architecture.
..\..\Program Files\Microsoft Platform SDK\Include/bthsdpdef.h:16: error: 'ULONGLONG' does not name a type
..\..\Program Files\Microsoft Platform SDK\Include/bthsdpdef.h:29: error: 'USHORT' does not name a type
... etc 500 errors..

Adding to .pro file extra include folder:
Qt Code:
  1. INCLUDEPATH += "C:\\Program Files\\Microsoft Platform SDK\\Include" "C:\\Program Files\\Microsoft Platform SDK\\Include\\crt"
To copy to clipboard, switch view to plain text mode 

Then I'm getting another erros:
..\..\Program Files\Microsoft Platform SDK\Include\crt/stddef.h:119: error: redeclaration of C++ built-in type 'wchar_t'
..\..\Program Files\Microsoft Platform SDK\Include\crt/stdlib.h:258: error: expected constructor, destructor, or type conversion before '_abs64'
..\..\Program Files\Microsoft Platform SDK\Include\crt/stdlib.h:267: error: expected initializer before '_byteswap_uint64'
... etc.. 500 other similar erros

The question:
How to compile 3rd party (windows api) stuff with QtCreator and mingw compiler?
Am I missing something? Is it possible with mingw at all or better to use msvc compiler?