PDA

View Full Version : unresolved external symbol __imp__GetKeyState@4



TriKri
10th May 2010, 11:35
Hi! I'm developing a Qt project in Visual Studio. I have created a Makefile Project in VS 2008, and in the code I call the function GetKeyState which is implemented in windows.h. However, when I'm compiling the project, I get this error message:

"user_interface.obj : error LNK2019: unresolved external symbol __imp__GetKeyState@4 referenced in function "unsigned char __cdecl get_key_down(int)" (?get_key_down@@YAEH@Z)"

I earlier compiled the same project using MinGW, but didn't have the same problem then; calling GetKeyState was just fine. Also, if I create a new empty Makefile Project in Visual Studio which calls GetKeyState, and create my own makefile for the project (hence not making a Qt project), I don't get the error either. So there must be something with the makefile generated by qmake that visual studio doesn't like, and makes the compiler unable to fins the function it looks for.

How can I fix this? Why do I get this error? Do I have to modify my .pro file? Thanks in advance.

-Kristofer