\sdk\include\wspiapi.h(47) : error C2265: '<Unknown>' : reference to a zero-sized 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()

  然后重新编译程序即可!
posted @ 2011-12-09 20:39  江湖超  阅读(284)  评论(0编辑  收藏  举报