我的程序中使用了CreateTimerQueueTimer函数,但编译时报该函数未定义,于是到MS的网站上下载了一个最新的SDK更新包,安装后在里面的文档说明中的确找到了这个函数的说明,满天欢喜的按照说明将几个文件夹设置到了VC6.0的Executable files、Include files、Library files中,但编译时仍然报该函数未定义。无语了……哪位DX救救我!

解决方案 »

  1.   

    在stdafx.h文件中

    第一个#include 前加上预编译指令:
    #define _WIN32_WINNT 0x0500 
    然后重新Rebuild All即可。
      

  2.   

    文档里说该函数是定义在winbase.h里的,只要包含windows.h就可以了的啊。
    这是msdn里的说明
    Client Requires Windows XP or Windows 2000 Professional. 
    Server Requires Windows Server 2003 or Windows 2000 Server. 
    Header Declared in Winbase.h; include Windows.h.
    Library Link to Kernel32.lib.
    DLL Requires Kernel32.dll.  
      

  3.   

    好像加了"#define _WIN32_WINNT 0x0500 "后还是不行啊
      

  4.   

    同意:wangk(倒之) 
    加上#define _WIN32_WINNT 0x0500如果仍然不行,建议安装最新的Platform SDK:Microsoft® Visual C++® includes content from the edition of the Platform SDK that was current at the time Visual C++ was released. Therefore, if you install the latest Platform SDK, you may end up with multiple versions of the same header files on your computer. To ensure that you are using the latest version of the SDK header files, follow the directions included in Installing the Platform SDK with Visual Studio. Otherwise, you will receive the following error when compiling code that uses features that were introduced after Visual C++ was released: error C2065: undeclared identifier.
      

  5.   

    我使用的Platform SDK 2003FEB,编译可以通过
      

  6.   

    哦,我将include files里的路径顺序换了一下就可以编译了。但现在link时却报了错
    Linking...
    TimerMsgBox2.obj : error LNK2001: unresolved external symbol __imp__DeleteTimerQueueTimer@12
    TimerMsgBox2.obj : error LNK2001: unresolved external symbol __imp__CreateTimerQueueTimer@28
    Debug/TimerMsgBox2.exe : fatal error LNK1120: 2 unresolved externals
    Error executing link.exe.还望各位救人救到底!
      

  7.   

    呵呵,现在好了。这次是library files里的顺序问题:)
    好,发分