Results 1 to 2 of 2

Thread: How to use Windows SDK in QT?

  1. #1
    Join Date
    Mar 2010
    Location
    Alipurduar, India
    Posts
    8
    Thanks
    4
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default How to use Windows SDK in QT?

    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?

  2. #2
    Join Date
    May 2010
    Location
    Romania
    Posts
    1,021
    Thanks
    62
    Thanked 260 Times in 246 Posts
    Qt products
    Qt5
    Platforms
    MacOS X Unix/X11 Windows Android

    Default Re: How to use Windows SDK in QT?

    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):
    Qt Code:
    1. #include <windows.h>
    2.  
    3. int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
    4. LPSTR lpCmdLine, int nCmdShow)
    5. {
    6. MessageBox(NULL, L"Hello world!", L"Note", MB_OK);
    7. return 0;
    8. }
    To copy to clipboard, switch view to plain text mode 

Similar Threads

  1. Replies: 2
    Last Post: 6th September 2010, 14:22
  2. Replies: 3
    Last Post: 12th July 2010, 06:25
  3. Program runs on Windows 7, crashes on Windows XP
    By JovianGhost in forum General Programming
    Replies: 8
    Last Post: 7th June 2010, 00:55
  4. Deployment Procedure On Windows On Linux and Windows
    By Harshith J.V. in forum Installation and Deployment
    Replies: 4
    Last Post: 9th July 2009, 11:27
  5. Replies: 10
    Last Post: 25th February 2007, 00:23

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.