Results 1 to 2 of 2

Thread: The simplest Qt program in Visual Studio that uses GetKeyState?

  1. #1
    Join Date
    May 2010
    Posts
    18
    Qt products
    Qt4
    Platforms
    Windows

    Default The simplest Qt program in Visual Studio that uses GetKeyState?

    Hi! Can someone please explain to me how I can make a really simple Qt program in Visual Studio, that can call the function GetKeyState in windows.h? I have tried to compile (using a Makefile Project, I guess that is what I have to choose) the smallest Qt program I can think of that uses GetKeyState, but I get an error message when I try to compile, saying "unresolved external symbol __imp__GetKeyState@4". Am I doing this right? Is it Makefile Project I should choose when I make a Visual Studio Qt project? And should I specify something more in order to make the compiler find GetKeyState? The lines that are executed when the project is built are "qmake -project", "qmake", and "nmake".

    Thanks in advance

    -Kristofer

  2. #2
    Join Date
    May 2010
    Posts
    18
    Qt products
    Qt4
    Platforms
    Windows

    Lightbulb Re: The simplest Qt program in Visual Studio that uses GetKeyState?

    I found the solution: To add "LIBS += User32.Lib" (without quotation signs) to my .pro file, and refrain from running "qmake -project" every time I compile to prevent the .pro file from being overwritten.

Similar Threads

  1. Replies: 3
    Last Post: 29th January 2010, 10:06
  2. Visual Studio Add-in
    By dima in forum Installation and Deployment
    Replies: 3
    Last Post: 5th August 2009, 07:36
  3. Visual Studio .NET & QT
    By fruzzo in forum Installation and Deployment
    Replies: 6
    Last Post: 3rd December 2007, 22:00
  4. Replies: 2
    Last Post: 23rd November 2007, 18:44
  5. Can't start program without MS Visual Studio installed
    By Jh_ in forum Installation and Deployment
    Replies: 1
    Last Post: 8th November 2006, 21:56

Tags for this Thread

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.