\sdk\include\wspiapi.h: error C2265: reference to a zero-sized array is illegal
http://www.drovik.com/ 2012-10-29 13:39:55 来源:CSDN社区 点击:
今天,编译了Gh0st源码发现个错误,原来是我VC6有问题哟,呵呵
百度、csdn都去了,终于解决了!不敢独享,特来分享..
编写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
源代码如:
-->原库文件代码:
#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
- #define _WSPIAPI_COUNTOF
- #include <stdio.h> // sprintf()
- #include <stdlib.h> // calloc(), strtoul()
- #include <malloc.h> // calloc()
- #include <string.h> // strlen(), strcmp(), strstr()
然后重新编译程序即可!
发表评论(6)
- 1楼 oakley replica wholesale sunglasses 发表于 2015-1-24 12:40:35
- right [url=http://chicnzic.fr/okbnews2.html]oakley replica wholesale sunglasses[/url]
- 2楼 oakley outlet store locations ny 发表于 2015-1-25 19:44:11
- night oakley outlet store locations ny
- 3楼 christian louboutin cheap knockoffs 发表于 2015-1-27 14:24:24
- seven christian louboutin cheap knockoffs
- 4楼 christian louboutin shoes discount size 12 发表于 2015-1-30 23:05:39
- where christian louboutin shoes discount size 12
- 5楼 coach outlet store rehoboth beach delaware 发表于 2015-2-13 0:07:03
- she coach outlet store rehoboth beach delaware
- 6楼 cheap coach tours to europe 发表于 2015-3-21 8:27:07
- are cheap coach tours to europe
查看更多评论>>>