\sdk\include\wspiapi.h(47) : error C2265: '' : reference to a zerosized array is illegal

编写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
源代码如:
-->原库文件代码:

ifndef WSPIAPIH_

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()

  然后重新编译程序即可!
邮箱 tickup [{at}] QQ.COM
原文地址:https://www.cnblogs.com/sevensky/p/2282688.html