您的位置:首页 > Web前端

\sdk\include\wspiapi.h(47) : error C2265: '<Unknown>' : reference to a zero-sized array is illegal

2011-08-02 14:04 429 查看
\sdk\include\wspiapi.h reference to a zero-sized array is illegal实践中的解决方法
2009-12-29 22:56
今天,编译了下盘古1.5的源码发现个错误,原来是我VC6.0的问题,呵呵

于是,马上求助了下百度大叔,不敢独享,特来分享。

编写IP多播程序时,要用到ip_mrep结构,在编译时会遇到如下的错误:

\sdk\include\wspiapi.h(47) : error C2265: '<Unknown>' : reference to a zero-sized array is illegal

这种错误是由于wspiapi.h头文件里缺少 #define _WSPIAPI_COUNTOF 语句造成的.

解决办法是:找到你安装的platformsdk/include目录下的wspiapi.h头文件,开头部分写如这条语句即可:#define _WSPIAPI_COUNTOF

如:

1>.源库文件代码:

#ifndef _WSPIAPI_H_

#define _WSPIAPI_H_

#include <stdio.h> // sprintf()

#include <stdlib.h> // calloc(), strtoul()

#include <malloc.h> // calloc()

#include <string.h> // strlen(), strcmp(), strstr()

修改后代码:

#ifndef _WSPIAPI_H_

#define _WSPIAPI_H_

//小天添加

//#define _WSPIAPI_COUNTOF

//

#include <stdio.h> // sprintf()

#include <stdlib.h> // calloc(), strtoul()

#include <malloc.h> // calloc()

#include <string.h> // strlen(), strcmp(), strstr()

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐