C ++ winsock服务器编程 [英] C ++ winsock server programming
问题描述
如何解决这个错误?
使用g ++编译器
C:\ Users \Chan \Desktop\f ***。cpp:在函数'int main()'中:
C:\ Users \Chan \Desktop\f ***。cpp:47:62:错误:' getaddrinfo'未在此范围内声明
C:\ Users \Chan \Desktop\f ***。cpp:58:28:错误:'freeaddrinfo'未在此声明范围
C:\ Users \Chan \Desktop\f ***。cpp:67:28:错误:'freeaddrinfo'未在此范围内声明
C:\ Users \Chan \Desktop\f ***。cpp:73:24:错误:'freeaddrinfo'未在此范围内声明
包含头文件 Ws2tcpip.h 。它位于Windows SDK的include目录中。
请参阅 http:// linux.die.net/man/3/getaddrinfo [ ^ ]。
How to solve this error?
Using g++ compiler
C:\Users\Chan\Desktop\f***.cpp: In function 'int main()':
C:\Users\Chan\Desktop\f***.cpp:47:62: error: 'getaddrinfo' was not declared in this scope
C:\Users\Chan\Desktop\f***.cpp:58:28: error: 'freeaddrinfo' was not declared in this scope
C:\Users\Chan\Desktop\f***.cpp:67:28: error: 'freeaddrinfo' was not declared in this scope
C:\Users\Chan\Desktop\f***.cpp:73:24: error: 'freeaddrinfo' was not declared in this scope
Include the header file Ws2tcpip.h. It is located in the include directory of the Windows SDK.
See http://linux.die.net/man/3/getaddrinfo[^].
这篇关于C ++ winsock服务器编程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!