我在VS中编译程序遇到这个错误:
error C3861: 'ReadDirectoryChangesW': identifier not found, even with argument-dependent lookup

差了一下MSDN,说是要包含 windows.h 头文件,我照做了,但是错误依旧。
为什么呢,不应该啊,明明已经按照MSDN中要求的做了,还是不行呢?

仔细阅读MSDN,发下这样一句话:
To compile an application that uses this function, define the _WIN32_WINNT macro as 0x0400 or later.

原来是要求 windows NT 的版本至少 4.0 以上,于是我在文件开头添加了如下定义:
#define _WIN32_WINNT 0x0500

编译成功!

看来有些API是在高版本的windows才能使用的。

相关文章:

  • 2021-12-04
  • 2021-11-01
  • 2021-10-27
  • 2022-12-23
  • 2021-04-30
  • 2022-01-02
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-07-05
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-06-30
  • 2021-11-16
相关资源
相似解决方案