Hi, I have written a C++ program, which I have previously compiled with MinGW. However, due to tricky circumstances (MinGW doesn't handle Boost very well apparently), I had to change to Visual Studio. The project compiles perfectly, except from one row, which calls the function GetKeyState located in windows.h. If I include that line in my code, I get the following compilation result:
Code:
------ Build started: Project: user_interface, Configuration: Release Win32 ------
Performing Makefile project actions
QFileInfo::absolutePath: Constructed with empty filename
Microsoft (R) Program Maintenance Utility Version 9.00.21022.08
Copyright (C) Microsoft Corporation. All rights reserved.
"c:\Program Files\Microsoft Visual Studio 9.0\VC\bin\nmake.exe" -f Makefile.Debug
Microsoft (R) Program Maintenance Utility Version 9.00.21022.08
Copyright (C) Microsoft Corporation. All rights reserved.
cl -c -nologo -Zm200 -Zc:wchar_t- -Zi -MDd -GR -EHsc -W3 -w34100 -w34189 -DUNICODE -DWIN32 -DQT_LARGEFILE_SUPPORT -DQT_DLL -DQT_GUI_LIB -DQT_CORE_LIB -DQT_THREAD_SUPPORT -I"c:\Program1\Qt\2010.02.1\qt\include\QtCore" -I"c:\Program1\Qt\2010.02.1\qt\include\QtGui" -I"c:\Program1\Qt\2010.02.1\qt\include" -I"." -I"c:\Program1\Qt\2010.02.1\qt\include\ActiveQt" -I"debug" -I"c:\Program1\Qt\2010.02.1\qt\mkspecs\default" -Fodebug\ @C:\Users\KRISTO~1\AppData\Local\Temp\nmD695.tmp
user_interface.cpp
link /LIBPATH:"c:\Program1\Qt\2010.02.1\qt\lib" /NOLOGO /DEBUG /MANIFEST /MANIFESTFILE:"debug\user_interface.intermediate.manifest" /SUBSYSTEM:WINDOWS "/MANIFESTDEPENDENCY:type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' publicKeyToken='6595b64144ccf1df' language='*' processorArchitecture='*'" /OUT:debug\user_interface.exe @C:\Users\KRISTO~1\AppData\Local\Temp\nmEAB3.tmp
LINK : debug\user_interface.exe not found or not built by the last incremental link; performing full link
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)
debug\user_interface.exe : fatal error LNK1120: 1 unresolved externals
NMAKE : fatal error U1077: '"c:\Program Files\Microsoft Visual Studio 9.0\VC\bin\link.EXE"' : return code '0x460'
Stop.
NMAKE : fatal error U1077: '"c:\Program Files\Microsoft Visual Studio 9.0\VC\bin\nmake.exe"' : return code '0x2'
Stop.
Project : error PRJ0019: A tool returned an error code from "Performing Makefile project actions"
Build log was saved at "file://d:\Work\TSEA27_(Elektronikprojektet)\Projektet\src\user_interface_visual_studio\user_interface\Release\BuildLog.htm"
user_interface - 5 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
"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)"
This is probably a beginner problem, but what is causing it and how do I solve it? If I have to include some library to make it work, how do I do that and where is the library located?