编写IP多播程序时,要用到ipmrep结构,在编译时会遇到如下的错误:
\sdk\include\wspiapi.h(47) : error C2265: '' : reference to a zero-sized array is illegal
这种错误是由于wspiapi.h头文件里缺少 #define _WSPIAPI
COUNTOF 语句造成的!
解决办法是:找到你安装的platformsdk/include目录下的wspiapi.h头文件,开头部分写如这条语句即可:#define WSPIAPICOUNTOF
源代码如:
-->原库文件代码:

define WSPIAPIH_

include // sprintf()

include // calloc(), strtoul()

include // calloc()

include // strlen(), strcmp(), strstr()

经过修改后代码:

ifndef WSPIAPIH_

define WSPIAPIH_

// 添加了#define WSPIAPICOUNTOF

define WSPIAPICOUNTOF

include // sprintf()

include // calloc(), strtoul()

include // calloc()

include // strlen(), strcmp(), strstr()

  然后重新编译程序即可!

相关文章:

  • 2021-07-26
  • 2021-07-03
  • 2022-12-23
  • 2021-12-28
  • 2021-12-14
  • 2021-07-15
  • 2022-01-19
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-08-07
  • 2022-12-23
相关资源
相似解决方案