读书人

网络编程序有关问题

发布时间: 2012-03-15 11:50:39 作者: rapoo

网络编程序问题
void WStest(){
StartupWinSock();
Sock=socket(TCP);
bind(Sock,Address);
listen(Sock);
ClientSock=accept(Sock);
while(!bQuit){
recv(ClienSock,buf);
}
closesocket(Sock);
closesocket(ClientSock);
CleanupWinSock();
}
/*编辑器为Dev-C++4990 错误如下:
E:\Program\temp\pt_3.cpp In function `void WStest() ':

15 E:\Program\temp\pt_3.cpp `StartupWinSock ' undeclared (first use this function)

(Each undeclared identifier is reported only once for each function it appears in.)

16 E:\Program\temp\pt_3.cpp `Sock ' undeclared (first use this function)

16 E:\Program\temp\pt_3.cpp `TCP ' undeclared (first use this function)

17 E:\Program\temp\pt_3.cpp `Address ' undeclared (first use this function)

19 E:\Program\temp\pt_3.cpp `ClientSock ' undeclared (first use this function)

20 E:\Program\temp\pt_3.cpp `bQuit ' undeclared (first use this function)

21 E:\Program\temp\pt_3.cpp `ClienSock ' undeclared (first use this function)

21 E:\Program\temp\pt_3.cpp `buf ' undeclared (first use this function)

25 E:\Program\temp\pt_3.cpp `CleanupWinSock ' undeclared (first use this function)


*/

[解决办法]
忘了头文件吧!

读书人网 >C++

热点推荐