首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > C++ >

C2011: 'ip_mreq' : 'struct' type redefinition解决思路

2013-11-23 
C2011: 'ip_mreq' : 'struct' type redefinition我在做一个程序,加上“#include ws2t

C2011: 'ip_mreq' : 'struct' type redefinition
我在做一个程序,加上“#include <ws2tcpip.h> ”以后程序
 就报错,帮我找一下原因!!
   代码如下: sock=socket(AF_INET,SOCK_RAW,IPPROTO_ICMP);
  if (sock == INVALID_SOCKET) {
              AfxMessageBox("Create socket failure!");
  return ;
  }
  //char ipaddress[48];
   dest.sin_addr.s_addr=inet_addr(IPaddress);
   dest.sin_family =AF_INET;



错误是:c:\program files\microsoft visual studio\vc98\include\ws2tcpip.h(22) : error C2011: 'ip_mreq' : 'struct' type redefinition
  大虾们帮我一下 MFC??? ws2tcpip MFC
[解决办法]
http://bbs.csdn.net/topics/80215483
[解决办法]
http://www.gamedev.net/topic/459333-winsock2-ws2tcpip-conflict-errors/
[解决办法]
error C2011: 'ip_mreq' : 'struct' type redefinition
重复定义了!
看看是不是重复包含头文件,是否加了保护!

热点排行