精华内容
下载资源
问答
  • winsock2
    2019-10-07 15:24:01

    工程中添加 Winsock2.h 报错

    1>c:\program files (x86)\windows kits\8.1\include\shared\ws2def.h(100): warning C4005: 'AF_IPX' : macro redefinition
    1> c:\program files (x86)\windows kits\8.1\include\um\winsock.h(452) : see previous definition of 'AF_IPX'
    1>c:\program files (x86)\windows kits\8.1\include\shared\ws2def.h(140): warning C4005: 'AF_MAX' : macro redefinition
    1> c:\program files (x86)\windows kits\8.1\include\um\winsock.h(471) : see previous definition of 'AF_MAX'
    1>c:\program files (x86)\windows kits\8.1\include\shared\ws2def.h(177): warning C4005: 'SO_DONTLINGER' : macro redefinition
    1> c:\program files (x86)\windows kits\8.1\include\um\winsock.h(394) : see previous definition of 'SO_DONTLINGER'
    1>c:\program files (x86)\windows kits\8.1\include\shared\ws2def.h(221): error C2011: 'sockaddr' : 'struct' type redefinition
    1> c:\program files (x86)\windows kits\8.1\include\um\winsock.h(477) : see declaration of 'sockaddr'
    1>c:\program files (x86)\windows kits\8.1\include\shared\ws2def.h(421): error C2059: syntax error : 'constant'
    1>c:\program files (x86)\windows kits\8.1\include\shared\ws2def.h(421): error C3805: 'constant': unexpected token, expected either '}' or a ','
    1>c:\program files (x86)\windows kits\8.1\include\shared\ws2def.h(556): warning C4005: 'IN_CLASSA' : macro redefinition
    1> c:\program files (x86)\windows kits\8.1\include\um\winsock.h(279) : see previous definition of 'IN_CLASSA'
    1>c:\program files (x86)\windows kits\8.1\include\shared\ws2def.h(562): warning C4005: 'IN_CLASSB' : macro redefinition
    1> c:\program files (x86)\windows kits\8.1\include\um\winsock.h(285) : see previous definition of 'IN_CLASSB'
    1>c:\program files (x86)\windows kits\8.1\include\shared\ws2def.h(568): warning C4005: 'IN_CLASSC' : macro redefinition
    1> c:\program files (x86)\windows kits\8.1\include\um\winsock.h(291) : see previous definition of 'IN_CLASSC'
    1>c:\program files (x86)\windows kits\8.1\include\shared\ws2def.h(579): warning C4005: 'INADDR_ANY' : macro redefinition
    1> c:\program files (x86)\windows kits\8.1\include\um\winsock.h(296) : see previous definition of 'INADDR_ANY'
    1>c:\program files (x86)\windows kits\8.1\include\shared\ws2def.h(581): warning C4005: 'INADDR_BROADCAST' : macro redefinition
    1> c:\program files (x86)\windows kits\8.1\include\um\winsock.h(298) : see previous definition of 'INADDR_BROADCAST'
    1>c:\program files (x86)\windows kits\8.1\include\shared\ws2def.h(615): error C2011: 'sockaddr_in' : 'struct' type redefinition
    1> c:\program files (x86)\windows kits\8.1\include\um\winsock.h(304) : see declaration of 'sockaddr_in'
    1>c:\program files (x86)\windows kits\8.1\include\um\winsock2.h(136): error C2011: 'fd_set' : 'struct' type redefinition
    1> c:\program files (x86)\windows kits\8.1\include\um\winsock.h(60) : see declaration of 'fd_set'
    1>c:\program files (x86)\windows kits\8.1\include\um\winsock2.h(156): warning C4005: 'FD_CLR' : macro redefinition
    1> c:\program files (x86)\windows kits\8.1\include\um\winsock.h(89) : see previous definition of 'FD_CLR'
    1>c:\program files (x86)\windows kits\8.1\include\um\winsock2.h(171): warning C4005: 'FD_SET' : macro redefinition
    1> c:\program files (x86)\windows kits\8.1\include\um\winsock.h(94) : see previous definition of 'FD_SET'
    1>c:\program files (x86)\windows kits\8.1\include\um\winsock2.h(180): error C2011: 'timeval' : 'struct' type redefinition
    1> c:\program files (x86)\windows kits\8.1\include\um\winsock.h(103) : see declaration of 'timeval'
    1>c:\program files (x86)\windows kits\8.1\include\um\winsock2.h(236): error C2011: 'hostent' : 'struct' type redefinition
    1> c:\program files (x86)\windows kits\8.1\include\um\winsock.h(159) : see declaration of 'hostent'
    1>c:\program files (x86)\windows kits\8.1\include\um\winsock2.h(249): error C2011: 'netent' : 'struct' type redefinition
    1> c:\program files (x86)\windows kits\8.1\include\um\winsock.h(172) : see declaration of 'netent'
    1>c:\program files (x86)\windows kits\8.1\include\um\winsock2.h(256): error C2011: 'servent' : 'struct' type redefinition
    1> c:\program files (x86)\windows kits\8.1\include\um\winsock.h(179) : see declaration of 'servent'
    1>c:\program files (x86)\windows kits\8.1\include\um\winsock2.h(268): error C2011: 'protoent' : 'struct' type redefinition
    1> c:\program files (x86)\windows kits\8.1\include\um\winsock.h(191) : see declaration of 'protoent'
    1>c:\program files (x86)\windows kits\8.1\include\um\winsock2.h(364): error C2011: 'WSAData' : 'struct' type redefinition
    1> c:\program files (x86)\windows kits\8.1\include\um\winsock.h(314) : see declaration of 'WSAData'
    1>c:\program files (x86)\windows kits\8.1\include\um\winsock2.h(462): error C2011: 'sockproto' : 'struct' type redefinition
    1> c:\program files (x86)\windows kits\8.1\include\um\winsock.h(486) : see declaration of 'sockproto'
    1>c:\program files (x86)\windows kits\8.1\include\um\winsock2.h(504): error C2011: 'linger' : 'struct' type redefinition
    1> c:\program files (x86)\windows kits\8.1\include\um\winsock.h(523) : see declaration of 'linger'
    1>c:\program files (x86)\windows kits\8.1\include\um\winsock2.h(517): warning C4005: 'SOMAXCONN' : macro redefinition
    1> c:\program files (x86)\windows kits\8.1\include\um\winsock.h(536) : see previous definition of 'SOMAXCONN'
    1>c:\program files (x86)\windows kits\8.1\include\um\winsock2.h(551): warning C4005: 'FD_READ' : macro redefinition
    1> c:\program files (x86)\windows kits\8.1\include\um\winsock.h(554) : see previous definition of 'FD_READ'
    1>c:\program files (x86)\windows kits\8.1\include\um\winsock2.h(554): warning C4005: 'FD_WRITE' : macro redefinition
    1> c:\program files (x86)\windows kits\8.1\include\um\winsock.h(555) : see previous definition of 'FD_WRITE'
    1>c:\program files (x86)\windows kits\8.1\include\um\winsock2.h(557): warning C4005: 'FD_OOB' : macro redefinition
    1> c:\program files (x86)\windows kits\8.1\include\um\winsock.h(556) : see previous definition of 'FD_OOB'
    1>c:\program files (x86)\windows kits\8.1\include\um\winsock2.h(560): warning C4005: 'FD_ACCEPT' : macro redefinition
    1> c:\program files (x86)\windows kits\8.1\include\um\winsock.h(557) : see previous definition of 'FD_ACCEPT'
    1>c:\program files (x86)\windows kits\8.1\include\um\winsock2.h(563): warning C4005: 'FD_CONNECT' : macro redefinition
    1> c:\program files (x86)\windows kits\8.1\include\um\winsock.h(558) : see previous definition of 'FD_CONNECT'
    1>c:\program files (x86)\windows kits\8.1\include\um\winsock2.h(566): warning C4005: 'FD_CLOSE' : macro redefinition
    1> c:\program files (x86)\windows kits\8.1\include\um\winsock.h(559) : see previous definition of 'FD_CLOSE'
    1>c:\program files (x86)\windows kits\8.1\include\um\winsock2.h(1650): error C2375: 'accept' : redefinition; different linkage
    1> c:\program files (x86)\windows kits\8.1\include\um\winsock.h(734) : see declaration of 'accept'
    1>c:\program files (x86)\windows kits\8.1\include\um\winsock2.h(1672): error C2375: 'bind' : redefinition; different linkage
    1> c:\program files (x86)\windows kits\8.1\include\um\winsock.h(739) : see declaration of 'bind'
    1>c:\program files (x86)\windows kits\8.1\include\um\winsock2.h(1691): error C2375: 'closesocket' : redefinition; different linkage
    1> c:\program files (x86)\windows kits\8.1\include\um\winsock.h(744) : see declaration of 'closesocket'
    1>c:\program files (x86)\windows kits\8.1\include\um\winsock2.h(1710): error C2375: 'connect' : redefinition; different linkage
    1> c:\program files (x86)\windows kits\8.1\include\um\winsock.h(746) : see declaration of 'connect'
    1>c:\program files (x86)\windows kits\8.1\include\um\winsock2.h(1731): error C2375: 'ioctlsocket' : redefinition; different linkage
    1> c:\program files (x86)\windows kits\8.1\include\um\winsock.h(751) : see declaration of 'ioctlsocket'
    1>c:\program files (x86)\windows kits\8.1\include\um\winsock2.h(1752): error C2375: 'getpeername' : redefinition; different linkage
    1> c:\program files (x86)\windows kits\8.1\include\um\winsock.h(756) : see declaration of 'getpeername'
    1>c:\program files (x86)\windows kits\8.1\include\um\winsock2.h(1773): error C2375: 'getsockname' : redefinition; different linkage
    1> c:\program files (x86)\windows kits\8.1\include\um\winsock.h(761) : see declaration of 'getsockname'
    1>c:\program files (x86)\windows kits\8.1\include\um\winsock2.h(1796): error C2375: 'getsockopt' : redefinition; different linkage
    1> c:\program files (x86)\windows kits\8.1\include\um\winsock.h(766) : see declaration of 'getsockopt'
    1>c:\program files (x86)\windows kits\8.1\include\um\winsock2.h(1817): error C2375: 'htonl' : redefinition; different linkage
    1> c:\program files (x86)\windows kits\8.1\include\um\winsock.h(773) : see declaration of 'htonl'
    1>c:\program files (x86)\windows kits\8.1\include\um\winsock2.h(1834): error C2375: 'htons' : redefinition; different linkage
    1> c:\program files (x86)\windows kits\8.1\include\um\winsock.h(775) : see declaration of 'htons'
    1>c:\program files (x86)\windows kits\8.1\include\um\winsock2.h(1852): error C2375: 'inet_addr' : redefinition; different linkage
    1> c:\program files (x86)\windows kits\8.1\include\um\winsock.h(777) : see declaration of 'inet_addr'
    1>c:\program files (x86)\windows kits\8.1\include\um\winsock2.h(1870): error C2375: 'inet_ntoa' : redefinition; different linkage
    1> c:\program files (x86)\windows kits\8.1\include\um\winsock.h(779) : see declaration of 'inet_ntoa'
    1>c:\program files (x86)\windows kits\8.1\include\um\winsock2.h(1971): error C2375: 'listen' : redefinition; different linkage
    1> c:\program files (x86)\windows kits\8.1\include\um\winsock.h(781) : see declaration of 'listen'
    1>c:\program files (x86)\windows kits\8.1\include\um\winsock2.h(1989): error C2375: 'ntohl' : redefinition; different linkage
    1> c:\program files (x86)\windows kits\8.1\include\um\winsock.h(785) : see declaration of 'ntohl'
    1>c:\program files (x86)\windows kits\8.1\include\um\winsock2.h(2006): error C2375: 'ntohs' : redefinition; different linkage
    1> c:\program files (x86)\windows kits\8.1\include\um\winsock.h(787) : see declaration of 'ntohs'
    1>c:\program files (x86)\windows kits\8.1\include\um\winsock2.h(2026): error C2375: 'recv' : redefinition; different linkage
    1> c:\program files (x86)\windows kits\8.1\include\um\winsock.h(789) : see declaration of 'recv'
    1>c:\program files (x86)\windows kits\8.1\include\um\winsock2.h(2051): error C2375: 'recvfrom' : redefinition; different linkage
    1> c:\program files (x86)\windows kits\8.1\include\um\winsock.h(795) : see declaration of 'recvfrom'
    1>c:\program files (x86)\windows kits\8.1\include\um\winsock2.h(2077): error C2375: 'select' : redefinition; different linkage
    1> c:\program files (x86)\windows kits\8.1\include\um\winsock.h(803) : see declaration of 'select'
    1>c:\program files (x86)\windows kits\8.1\include\um\winsock2.h(2101): error C2375: 'send' : redefinition; different linkage
    1> c:\program files (x86)\windows kits\8.1\include\um\winsock.h(810) : see declaration of 'send'
    1>c:\program files (x86)\windows kits\8.1\include\um\winsock2.h(2126): error C2375: 'sendto' : redefinition; different linkage
    1> c:\program files (x86)\windows kits\8.1\include\um\winsock.h(816) : see declaration of 'sendto'
    1>c:\program files (x86)\windows kits\8.1\include\um\winsock2.h(2152): error C2375: 'setsockopt' : redefinition; different linkage
    1> c:\program files (x86)\windows kits\8.1\include\um\winsock.h(824) : see declaration of 'setsockopt'
    1>c:\program files (x86)\windows kits\8.1\include\um\winsock2.h(2174): error C2375: 'shutdown' : redefinition; different linkage
    1> c:\program files (x86)\windows kits\8.1\include\um\winsock.h(831) : see declaration of 'shutdown'
    1>c:\program files (x86)\windows kits\8.1\include\um\winsock2.h(2195): error C2375: 'socket' : redefinition; different linkage
    1> c:\program files (x86)\windows kits\8.1\include\um\winsock.h(835) : see declaration of 'socket'
    1>c:\program files (x86)\windows kits\8.1\include\um\winsock2.h(2220): error C2375: 'gethostbyaddr' : redefinition; different linkage
    1> c:\program files (x86)\windows kits\8.1\include\um\winsock.h(842) : see declaration of 'gethostbyaddr'
    1>c:\program files (x86)\windows kits\8.1\include\um\winsock2.h(2240): error C2375: 'gethostbyname' : redefinition; different linkage
    1> c:\program files (x86)\windows kits\8.1\include\um\winsock.h(847) : see declaration of 'gethostbyname'
    1>c:\program files (x86)\windows kits\8.1\include\um\winsock2.h(2258): error C2375: 'gethostname' : redefinition; different linkage
    1> c:\program files (x86)\windows kits\8.1\include\um\winsock.h(849) : see declaration of 'gethostname'
    1>c:\program files (x86)\windows kits\8.1\include\um\winsock2.h(2298): error C2375: 'getservbyport' : redefinition; different linkage
    1> c:\program files (x86)\windows kits\8.1\include\um\winsock.h(853) : see declaration of 'getservbyport'
    1>c:\program files (x86)\windows kits\8.1\include\um\winsock2.h(2317): error C2375: 'getservbyname' : redefinition; different linkage
    1> c:\program files (x86)\windows kits\8.1\include\um\winsock.h(857) : see declaration of 'getservbyname'
    1>c:\program files (x86)\windows kits\8.1\include\um\winsock2.h(2335): error C2375: 'getprotobynumber' : redefinition; different linkage
    1> c:\program files (x86)\windows kits\8.1\include\um\winsock.h(861) : see declaration of 'getprotobynumber'
    1>c:\program files (x86)\windows kits\8.1\include\um\winsock2.h(2352): error C2375: 'getprotobyname' : redefinition; different linkage
    1> c:\program files (x86)\windows kits\8.1\include\um\winsock.h(863) : see declaration of 'getprotobyname'
    1>c:\program files (x86)\windows kits\8.1\include\um\winsock2.h(2373): error C2375: 'WSAStartup' : redefinition; different linkage
    1> c:\program files (x86)\windows kits\8.1\include\um\winsock.h(867) : see declaration of 'WSAStartup'
    1>c:\program files (x86)\windows kits\8.1\include\um\winsock2.h(2392): error C2375: 'WSACleanup' : redefinition; different linkage
    1> c:\program files (x86)\windows kits\8.1\include\um\winsock.h(871) : see declaration of 'WSACleanup'
    1>c:\program files (x86)\windows kits\8.1\include\um\winsock2.h(2409): error C2375: 'WSASetLastError' : redefinition; different linkage
    1> c:\program files (x86)\windows kits\8.1\include\um\winsock.h(873) : see declaration of 'WSASetLastError'
    1>c:\program files (x86)\windows kits\8.1\include\um\winsock2.h(2426): error C2375: 'WSAGetLastError' : redefinition; different linkage
    1> c:\program files (x86)\windows kits\8.1\include\um\winsock.h(875) : see declaration of 'WSAGetLastError'
    1>c:\program files (x86)\windows kits\8.1\include\um\winsock2.h(2447): error C2375: 'WSAIsBlocking' : redefinition; different linkage
    1> c:\program files (x86)\windows kits\8.1\include\um\winsock.h(877) : see declaration of 'WSAIsBlocking'
    1>c:\program files (x86)\windows kits\8.1\include\um\winsock2.h(2465): error C2375: 'WSAUnhookBlockingHook' : redefinition; different linkage
    1> c:\program files (x86)\windows kits\8.1\include\um\winsock.h(879) : see declaration of 'WSAUnhookBlockingHook'
    1>c:\program files (x86)\windows kits\8.1\include\um\winsock2.h(2483): error C2375: 'WSASetBlockingHook' : redefinition; different linkage
    1> c:\program files (x86)\windows kits\8.1\include\um\winsock.h(881) : see declaration of 'WSASetBlockingHook'
    1>c:\program files (x86)\windows kits\8.1\include\um\winsock2.h(2501): error C2375: 'WSACancelBlockingCall' : redefinition; different linkage
    1> c:\program files (x86)\windows kits\8.1\include\um\winsock.h(883) : see declaration of 'WSACancelBlockingCall'
    1>c:\program files (x86)\windows kits\8.1\include\um\winsock2.h(2524): error C2375: 'WSAAsyncGetServByName' : redefinition; different linkage
    1> c:\program files (x86)\windows kits\8.1\include\um\winsock.h(885) : see declaration of 'WSAAsyncGetServByName'
    1>c:\program files (x86)\windows kits\8.1\include\um\winsock2.h(2552): error C2375: 'WSAAsyncGetServByPort' : redefinition; different linkage
    1> c:\program files (x86)\windows kits\8.1\include\um\winsock.h(893) : see declaration of 'WSAAsyncGetServByPort'
    1>c:\program files (x86)\windows kits\8.1\include\um\winsock2.h(2579): error C2375: 'WSAAsyncGetProtoByName' : redefinition; different linkage
    1> c:\program files (x86)\windows kits\8.1\include\um\winsock.h(901) : see declaration of 'WSAAsyncGetProtoByName'
    1>c:\program files (x86)\windows kits\8.1\include\um\winsock2.h(2605): error C2375: 'WSAAsyncGetProtoByNumber' : redefinition; different linkage
    1> c:\program files (x86)\windows kits\8.1\include\um\winsock.h(908) : see declaration of 'WSAAsyncGetProtoByNumber'
    1>c:\program files (x86)\windows kits\8.1\include\um\winsock2.h(2631): error C2375: 'WSAAsyncGetHostByName' : redefinition; different linkage
    1> c:\program files (x86)\windows kits\8.1\include\um\winsock.h(915) : see declaration of 'WSAAsyncGetHostByName'
    1>c:\program files (x86)\windows kits\8.1\include\um\winsock2.h(2659): error C2375: 'WSAAsyncGetHostByAddr' : redefinition; different linkage
    1> c:\program files (x86)\windows kits\8.1\include\um\winsock.h(922) : see declaration of 'WSAAsyncGetHostByAddr'
    1>c:\program files (x86)\windows kits\8.1\include\um\winsock2.h(2683): error C2375: 'WSACancelAsyncRequest' : redefinition; different linkage
    1> c:\program files (x86)\windows kits\8.1\include\um\winsock.h(931) : see declaration of 'WSACancelAsyncRequest'
    1>c:\program files (x86)\windows kits\8.1\include\um\winsock2.h(2704): error C2375: 'WSAAsyncSelect' : redefinition; different linkage
    1> c:\program files (x86)\windows kits\8.1\include\um\winsock.h(933) : see declaration of 'WSAAsyncSelect'

     

    解决方法:

       包含#include <Winsock2.h>在#include <windows.h>之前



    转载于:https://www.cnblogs.com/staring-hxs/p/6002767.html

    更多相关内容
  • WinSock2.rar,WinSock2.pas
  • C语言头文件 WINSOCK2

    2022-06-13 20:40:38
    C语言头文件 WINSOCK2C语言头文件 WINSOCK2C语言头文件 WINSOCK2C语言头文件 WINSOCK2C语言头文件 WINSOCK2C语言头文件 WINSOCK2C语言头文件 WINSOCK2C语言头文件 WINSOCK2C语言头文件 WINSOCK2C语言头文件 WINSOCK...
  • 看任务管理器dhcp服务占用很高 cmd ping同局域网地址可以ping通,ping外网不行 使用cmd 输入netsh winsock reset 显示找不到指定文件 解决办法: 怀疑是winsock 和winsock2损坏,替换winsock注册表
  • 2.8 winsock2新增函数一览 2.9 一个简单的客户机朋艮务器的实现 2.9.1 服务器端的实现 2.9.2 客户端的实现 2.9.3 实例分析 2.10 本章小结 2.11 习题 第3章 微软vbwinsock控件 3.1 winsock控件的...
  • 误删注册表winsock没有备份,导致无法上网时,导入这两个文件马上就可以解决。 正常上网的win10家庭版中导出的。 下载后可直接使用
  • 使用winsock2 API和TCP协议的多线程聊天应用程序。 用法 客户 cd client cmake -G " MinGW Makefiles " ./ make -f ./MakeFile 服务器 cd server cmake -G " MinGW Makefiles " ./ make -f ./MakeFile
  • winsock2 编写的下载demo,里面包含服务器和客户端,带界面,非多线程,非断点续传
  • WinSock2.reg

    2019-12-13 15:20:00
    网络无法访问包Winsock2.2错误的注册表导入配置,本文件为win10专业版操作系统导出的正确注册表配置文件,实践验证可修复win10 家庭版的网络配置
  • C ++ HTTP / 1.1 基于winsock2和IOCP的自我实现的HTTP / 1.1。去做 IOCP模型 接受 收视率 发送 关闭服务器和套接字接口 服务器启动 服务器关闭 服务器onAccept 服务器关闭 套接字onRecv 插座开启关闭 套接字写 插座...
  • WINSOCKAPI2设计简单的WINSOCKAPI2文件包括服务器界面
  • WinSock2.pas

    2019-06-13 20:23:34
    Delphi的WinSock2.pas文件,供网络编程使用 使用方法:WinSock2.pas安装步骤,Componet--> install component..--> 选择WinSock2.pas文件--> install;
  • C\C++基于WinSock2编写的PING程序,每一行我都注释了代码作用,很完整 复制粘贴即可使用
  • winsock2

    2012-12-26 18:22:03
    winsock2
  • C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\ws2def.h(91) : warning C4005: “AF_IPX”: 宏重定义 1> C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\winsock.h(460) : 参见“AF_IPX”的前...

    开发环境

    编译器:VS2008
    OS:Windows 10

    报错信息

    1>C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\ws2def.h(91) : warning C4005: “AF_IPX”: 宏重定义
    1>        C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\winsock.h(460) : 参见“AF_IPX”的前一个定义
    1>C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\ws2def.h(127) : warning C4005: “AF_MAX”: 宏重定义
    1>        C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\winsock.h(479) : 参见“AF_MAX”的前一个定义
    1>C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\ws2def.h(163) : warning C4005: “SO_DONTLINGER”: 宏重定义
    1>        C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\winsock.h(402) : 参见“SO_DONTLINGER”的前一个定义
    1>C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\ws2def.h(206) : error C2011: “sockaddr”:struct”类型重定义
    1>        C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\winsock.h(485) : 参见“sockaddr”的声明
    1>C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\ws2def.h(384) : error C2143: 语法错误 : 缺少“}(在“常量”的前面)
    1>C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\ws2def.h(384) : error C2143: 语法错误 : 缺少“;(在“常量”的前面)
    1>C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\ws2def.h(384) : error C2059: 语法错误 : “常量”
    1>C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\ws2def.h(437) : error C2143: 语法错误 : 缺少“;(在“}”的前面)
    1>C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\ws2def.h(437) : error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int
    1>C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\ws2def.h(437) : error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int
    1>C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\ws2def.h(518) : warning C4005: “IN_CLASSA”: 宏重定义
    1>        C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\winsock.h(287) : 参见“IN_CLASSA”的前一个定义
    1>C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\ws2def.h(524) : warning C4005: “IN_CLASSB”: 宏重定义
    1>        C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\winsock.h(293) : 参见“IN_CLASSB”的前一个定义
    1>C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\ws2def.h(530) : warning C4005: “IN_CLASSC”: 宏重定义
    1>        C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\winsock.h(299) : 参见“IN_CLASSC”的前一个定义
    1>C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\ws2def.h(541) : warning C4005: “INADDR_ANY”: 宏重定义
    1>        C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\winsock.h(304) : 参见“INADDR_ANY”的前一个定义
    1>C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\ws2def.h(543) : warning C4005: “INADDR_BROADCAST”: 宏重定义
    1>        C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\winsock.h(306) : 参见“INADDR_BROADCAST”的前一个定义
    1>C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\ws2def.h(577) : error C2011: “sockaddr_in”:struct”类型重定义
    1>        C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\winsock.h(312) : 参见“sockaddr_in”的声明
    1>C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\winsock2.h(132) : error C2011: “fd_set”:struct”类型重定义
    1>        C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\winsock.h(68) : 参见“fd_set”的声明
    1>C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\winsock2.h(167) : warning C4005: “FD_SET”: 宏重定义
    1>        C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\winsock.h(102) : 参见“FD_SET”的前一个定义
    1>C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\winsock2.h(176) : error C2011: “timeval”:struct”类型重定义
    1>        C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\winsock.h(111) : 参见“timeval”的声明
    1>C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\winsock2.h(232) : error C2011: “hostent”:struct”类型重定义
    1>        C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\winsock.h(167) : 参见“hostent”的声明
    1>C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\winsock2.h(245) : error C2011: “netent”:struct”类型重定义
    1>        C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\winsock.h(180) : 参见“netent”的声明
    1>C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\winsock2.h(252) : error C2011: “servent”:struct”类型重定义
    1>        C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\winsock.h(187) : 参见“servent”的声明
    1>C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\winsock2.h(264) : error C2011: “protoent”:struct”类型重定义
    1>        C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\winsock.h(199) : 参见“protoent”的声明
    1>C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\winsock2.h(360) : error C2011: “WSAData”:struct”类型重定义
    1>        C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\winsock.h(322) : 参见“WSAData”的声明
    1>C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\winsock2.h(458) : error C2011: “sockproto”:struct”类型重定义
    1>        C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\winsock.h(494) : 参见“sockproto”的声明
    1>C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\winsock2.h(500) : error C2011: “linger”:struct”类型重定义
    1>        C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\winsock.h(531) : 参见“linger”的声明
    1>C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\winsock2.h(513) : warning C4005: “SOMAXCONN”: 宏重定义
    1>        C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\winsock.h(544) : 参见“SOMAXCONN”的前一个定义
    1>C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\winsock2.h(542) : warning C4005: “FD_READ”: 宏重定义
    1>        C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\winsock.h(562) : 参见“FD_READ”的前一个定义
    1>C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\winsock2.h(545) : warning C4005: “FD_WRITE”: 宏重定义
    1>        C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\winsock.h(563) : 参见“FD_WRITE”的前一个定义
    1>C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\winsock2.h(548) : warning C4005: “FD_OOB”: 宏重定义
    1>        C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\winsock.h(564) : 参见“FD_OOB”的前一个定义
    1>C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\winsock2.h(551) : warning C4005: “FD_ACCEPT”: 宏重定义
    1>        C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\winsock.h(565) : 参见“FD_ACCEPT”的前一个定义
    1>C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\winsock2.h(554) : warning C4005: “FD_CONNECT”: 宏重定义
    1>        C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\winsock.h(566) : 参见“FD_CONNECT”的前一个定义
    1>C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\winsock2.h(557) : warning C4005: “FD_CLOSE”: 宏重定义
    1>        C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\winsock.h(567) : 参见“FD_CLOSE”的前一个定义
    1>C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\winsock2.h(1527) : error C2375: “accept”: 重定义;不同的链接
    1>        C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\winsock.h(735) : 参见“accept”的声明
    1>C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\winsock2.h(1548) : error C2375: “bind”: 重定义;不同的链接
    1>        C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\winsock.h(740) : 参见“bind”的声明
    1>C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\winsock2.h(1567) : error C2375: “closesocket”: 重定义;不同的链接
    1>        C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\winsock.h(745) : 参见“closesocket”的声明
    1>C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\winsock2.h(1586) : error C2375: “connect”: 重定义;不同的链接
    1>        C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\winsock.h(747) : 参见“connect”的声明
    1>C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\winsock2.h(1607) : error C2375: “ioctlsocket”: 重定义;不同的链接
    1>        C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\winsock.h(752) : 参见“ioctlsocket”的声明
    1>C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\winsock2.h(1628) : error C2375: “getpeername”: 重定义;不同的链接
    1>        C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\winsock.h(757) : 参见“getpeername”的声明
    1>C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\winsock2.h(1649) : error C2375: “getsockname”: 重定义;不同的链接
    1>        C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\winsock.h(762) : 参见“getsockname”的声明
    1>C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\winsock2.h(1672) : error C2375: “getsockopt”: 重定义;不同的链接
    1>        C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\winsock.h(767) : 参见“getsockopt”的声明
    1>C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\winsock2.h(1693) : error C2375: “htonl”: 重定义;不同的链接
    1>        C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\winsock.h(774) : 参见“htonl”的声明
    1>C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\winsock2.h(1710) : error C2375: “htons”: 重定义;不同的链接
    1>        C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\winsock.h(776) : 参见“htons”的声明
    1>C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\winsock2.h(1728) : error C2375: “inet_addr”: 重定义;不同的链接
    1>        C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\winsock.h(778) : 参见“inet_addr”的声明
    1>C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\winsock2.h(1745) : error C2375: “inet_ntoa”: 重定义;不同的链接
    1>        C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\winsock.h(780) : 参见“inet_ntoa”的声明
    1>C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\winsock2.h(1763) : error C2375: “listen”: 重定义;不同的链接
    1>        C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\winsock.h(782) : 参见“listen”的声明
    1>C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\winsock2.h(1781) : error C2375: “ntohl”: 重定义;不同的链接
    1>        C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\winsock.h(786) : 参见“ntohl”的声明
    1>C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\winsock2.h(1798) : error C2375: “ntohs”: 重定义;不同的链接
    1>        C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\winsock.h(788) : 参见“ntohs”的声明
    1>C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\winsock2.h(1818) : error C2375: “recv”: 重定义;不同的链接
    1>        C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\winsock.h(790) : 参见“recv”的声明
    1>C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\winsock2.h(1843) : error C2375: “recvfrom”: 重定义;不同的链接
    1>        C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\winsock.h(796) : 参见“recvfrom”的声明
    1>C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\winsock2.h(1869) : error C2375: “select”: 重定义;不同的链接
    1>        C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\winsock.h(804) : 参见“select”的声明
    1>C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\winsock2.h(1893) : error C2375: “send”: 重定义;不同的链接
    1>        C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\winsock.h(811) : 参见“send”的声明
    1>C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\winsock2.h(1918) : error C2375: “sendto”: 重定义;不同的链接
    1>        C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\winsock.h(817) : 参见“sendto”的声明
    1>C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\winsock2.h(1944) : error C2375: “setsockopt”: 重定义;不同的链接
    1>        C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\winsock.h(825) : 参见“setsockopt”的声明
    1>C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\winsock2.h(1966) : error C2375: “shutdown”: 重定义;不同的链接
    1>        C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\winsock.h(832) : 参见“shutdown”的声明
    1>C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\winsock2.h(1986) : error C2375: “socket”: 重定义;不同的链接
    1>        C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\winsock.h(836) : 参见“socket”的声明
    1>C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\winsock2.h(2009) : error C2375: “gethostbyaddr”: 重定义;不同的链接
    1>        C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\winsock.h(843) : 参见“gethostbyaddr”的声明
    1>C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\winsock2.h(2029) : error C2375: “gethostbyname”: 重定义;不同的链接
    1>        C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\winsock.h(848) : 参见“gethostbyname”的声明
    1>C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\winsock2.h(2047) : error C2375: “gethostname”: 重定义;不同的链接
    1>        C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\winsock.h(850) : 参见“gethostname”的声明
    1>C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\winsock2.h(2067) : error C2375: “getservbyport”: 重定义;不同的链接
    1>        C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\winsock.h(854) : 参见“getservbyport”的声明
    1>C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\winsock2.h(2087) : error C2375: “getservbyname”: 重定义;不同的链接
    1>        C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\winsock.h(858) : 参见“getservbyname”的声明
    1>C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\winsock2.h(2106) : error C2375: “getprotobynumber”: 重定义;不同的链接
    1>        C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\winsock.h(862) : 参见“getprotobynumber”的声明
    1>C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\winsock2.h(2124) : error C2375: “getprotobyname”: 重定义;不同的链接
    1>        C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\winsock.h(864) : 参见“getprotobyname”的声明
    1>C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\winsock2.h(2145) : error C2375: “WSAStartup”: 重定义;不同的链接
    1>        C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\winsock.h(868) : 参见“WSAStartup”的声明
    1>C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\winsock2.h(2163) : error C2375: “WSACleanup”: 重定义;不同的链接
    1>        C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\winsock.h(872) : 参见“WSACleanup”的声明
    1>C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\winsock2.h(2180) : error C2375: “WSASetLastError”: 重定义;不同的链接
    1>        C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\winsock.h(874) : 参见“WSASetLastError”的声明
    1>C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\winsock2.h(2197) : error C2375: “WSAGetLastError”: 重定义;不同的链接
    1>        C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\winsock.h(876) : 参见“WSAGetLastError”的声明
    1>C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\winsock2.h(2214) : error C2375: “WSAIsBlocking”: 重定义;不同的链接
    1>        C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\winsock.h(878) : 参见“WSAIsBlocking”的声明
    1>C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\winsock2.h(2231) : error C2375: “WSAUnhookBlockingHook”: 重定义;不同的链接
    1>        C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\winsock.h(880) : 参见“WSAUnhookBlockingHook”的声明
    1>C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\winsock2.h(2248) : error C2375: “WSASetBlockingHook”: 重定义;不同的链接
    1>        C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\winsock.h(882) : 参见“WSASetBlockingHook”的声明
    1>C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\winsock2.h(2265) : error C2375: “WSACancelBlockingCall”: 重定义;不同的链接
    1>        C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\winsock.h(884) : 参见“WSACancelBlockingCall”的声明
    1>C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\winsock2.h(2287) : error C2375: “WSAAsyncGetServByName”: 重定义;不同的链接
    1>        C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\winsock.h(886) : 参见“WSAAsyncGetServByName”的声明
    1>C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\winsock2.h(2314) : error C2375: “WSAAsyncGetServByPort”: 重定义;不同的链接
    1>        C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\winsock.h(894) : 参见“WSAAsyncGetServByPort”的声明
    1>C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\winsock2.h(2340) : error C2375: “WSAAsyncGetProtoByName”: 重定义;不同的链接
    1>        C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\winsock.h(902) : 参见“WSAAsyncGetProtoByName”的声明
    1>C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\winsock2.h(2365) : error C2375: “WSAAsyncGetProtoByNumber”: 重定义;不同的链接
    1>        C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\winsock.h(909) : 参见“WSAAsyncGetProtoByNumber”的声明
    1>C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\winsock2.h(2390) : error C2375: “WSAAsyncGetHostByName”: 重定义;不同的链接
    1>        C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\winsock.h(916) : 参见“WSAAsyncGetHostByName”的声明
    1>C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\winsock2.h(2417) : error C2375: “WSAAsyncGetHostByAddr”: 重定义;不同的链接
    1>        C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\winsock.h(923) : 参见“WSAAsyncGetHostByAddr”的声明
    1>C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\winsock2.h(2440) : error C2375: “WSACancelAsyncRequest”: 重定义;不同的链接
    1>        C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\winsock.h(932) : 参见“WSACancelAsyncRequest”的声明
    1>C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\winsock2.h(2461) : error C2375: “WSAAsyncSelect”: 重定义;不同的链接
    1>        C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\winsock.h(934) : 参见“WSAAsyncSelect”的声明
    1>C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\winsock2.h(3910) : error C2059: 语法错误 :}1>C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\winsock2.h(3910) : error C2143: 语法错误 : 缺少“;(在“}”的前面)
    1>C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\winsock2.h(3910) : error C2059: 语法错误 :}1>g:\ms项目\模块化\src\devices\dodocr\dodocr\WSocket.h(32) : error C2061: 语法错误 : 标识符“DEALPROC”
    1>g:\ms项目\模块化\src\devices\dodocr\dodocr\WSocket.h(97) : error C2146: 语法错误 : 缺少“;(在标识符“lpDealFunc”的前面)
    1>g:\ms项目\模块化\src\devices\dodocr\dodocr\WSocket.h(97) : error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int
    1>g:\ms项目\模块化\src\devices\dodocr\dodocr\WSocket.h(97) : error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int
    1>g:\ms项目\模块化\src\devices\dodocr\dodocr\WSocket.h(105) : error C2146: 语法错误 : 缺少“;(在标识符“lpDealFunc”的前面)
    1>g:\ms项目\模块化\src\devices\dodocr\dodocr\WSocket.h(105) : error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int
    1>g:\ms项目\模块化\src\devices\dodocr\dodocr\WSocket.h(105) : error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int
    

    原因:

    主要原因是因为<Windows.h>中包含了<Winsock.h>头文件,由于其版本的不同

    解决:

    1. 添加预编译头

    项目属性 ->C/C++ -> 预处理器 -> 预处理器定义

    增加如下定义

    WIN32_LEAN_AND_MEAN

    在这里插入图片描述
    2. 在编译不过的头文件前面增加

    #include <Winsock2.h>,特别是用到了<windows.h>

    测试了第一种方法是可行的。

    参考:CSDN博客

    展开全文
  • SPI.rar_winsock2过滤

    2022-09-22 22:09:14
    描述了SPI的数据报过滤原理与实现,使用到了WINSOCK2的相关内容。类防火墙功能。
  • 客户端卸载后上不网的解决方法,winsock和winsock2注册表,用于重新修复10的注册表
  • 防火墙可以实施和执行网络访问策略,但是,传统的防火墙技术集中于如何防范外部网络对内部网络的入侵和攻击上,而对于如何控制...针对这一问题,我们从应用层网关技术入手,利用WinSock2 SPI技术,进行了研究和探讨。
  • 在windows.h中,定义了一段代码: 其中定义了winsock.h,而如果在自己的文件中,再去定义winsock2.h,则会出现文件重定义错误; 解决方法: #define WIN32_LEAN_AND_MEAN 关于WIN32_LEAN_AND_MEAN 1. WIN32_LEAN_...

    在windows.h中,定义了一段代码:

     其中定义了winsock.h,而如果在自己的文件中,再去定义winsock2.h,则会出现文件重定义错误;

    解决方法: #define WIN32_LEAN_AND_MEAN

    关于WIN32_LEAN_AND_MEAN

    1.  WIN32_LEAN_AND_MEAN用来排除一些不常用的API用于减小头文件大小,例如Cryptography, DDE, RPC, Shell, and Windows Sockets之类的头文件。
    2. Windows.h头文件中包含的Winsock.h与Winsock2.h冲突,编译会报错,可以通过定义WIN32_LEAN_AND_MEAN解决。
    3. 使用NOXXX宏定义排除指定的API,例如NOCOMM排除了串行通信API。
     

    展开全文
  • win10误删注册表winsock和winsock2导致wifi显示无internet怎么解决

    目录

    方法1:从其他可以正常上网的电脑获取winsock和winsock2导入

    方法2:重装TCP/IP协议(win10家庭版无法使用此方法解决)

     

    方法1:从其他可以正常上网的电脑获取winsock和winsock2导入

    Win+r输入regedit进入注册表

    计算机\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services删除winsock和winsock2

     

    回到上级目录计算机\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services->点击文件->导入下面两个文件winsock和winsock2

    点击此链接,下载winsock和winsock2 

    以管理员身份运行cmd

    • 输入netsh winsock reset

    重启电脑 

    方法2:重装TCP/IP协议(win10家庭版无法使用此方法解决)

    从控制面板->网络和internet->网络和控制中心->更改适配器

    右键wlan->属性->iptcp4->安装->双击协议->点击从磁盘安装->浏览

     

    C:\Windows\INF->文件名输入*.inf->确定

     TCP/IP4

     

    如果出现组策略错误

    点击此链接解决“添加tcp/ip时,未能添加要求的功能,错误是:组策略阻止了这个程序。要获取详细信息,请与系统管理员联系”

    展开全文
  • 用SPI加密数据包。基于WINSOCK2 SPI层。
  • Winsock2文件

    2009-08-14 10:34:03
    delphi Socket Winsock2文件
  • VC下基于winsock2的原始套接子发送程序,含有详细的注释说明,是学习网络编程的很好的例子
  • winsock2.h 是什么

    千次阅读 2021-10-08 11:28:26
    Winsock 2.h> #include<stdio.h> #define DEFAULT_PORT 5050 #define DATA_BUFFER 1024 void main(int argc,char *argv[]) { WSADATA wsaData; SOCKET sClient; int iPort= DEFAULT_PORT; int iLen; ...
  • windows.h与winsock2.h的包含顺序 大凡在Windows平台下用C++做网络开发很多时候都会同时包含这两个头文件,如若顺序不当(windows.h先于winsock2.h)就会出现很多莫名其妙的错误。诸如: 警告 4 warning C4005: “AF_...
  • 方法一:手动安装TCP/IP协议 方法一仅限于win10专业版,因为win...输入regedit.exe,打开注册表编辑器,右键删除Winsock和Winsock2(若已删则跳过),路径如下: HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services
  • 第1章 计算机网络基础 ...第9章 Winsock 2完成端口的开发 第10章 常规服务质量 附录A Windows Socket错误代码 附录B Windows Socket 1.x库函数及其扩展 附录C Windows Socket 2扩展库函数简要参考

空空如也

空空如也

1 2 3 4 5 ... 20
收藏数 54,019
精华内容 21,607
关键字:

winsock2