近日在做项目时需要使用到 GetLastInputInfo 函数,添加了 #include <windows.h> 头文件,写了代码,编译时报出下列错误:

D:\CODE\del\del.cpp(21) : error C2065:'LASTINPUTINFO' : undeclared identifier
D:\CODE\del\del.cpp(23) : error C2065: 'GetLastInputInfo' : undeclared identifier

 

 

 

 

 

各种解决后,在网上看到一个解决方法,网址如下:

http://forums.codeguru.com/showthread.php?253474-Why-i-cant-compile-code-that-uses-GetLastInputInfo

 

解决方法:

添加预定义宏 _WIN32_WINNT=0x0500

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

posted on 2014-02-28 09:54  二号匪  阅读(660)  评论(0编辑  收藏  举报